首先,我想为我糟糕的英语道歉。
我正在尝试使用ev3dev2库和Visual Studio Code将python代码添加到我的ev3机器人中。我的问题是,当我试图使用类'Leds‘中的函数'animate_stop’(或‘动画_闪光’,‘重置’等)时,我得到一个错误,说被调用的函数不是对象'Leds‘的属性,但当我打开'led.py’文件(其中包含'Leds‘类)时,我发现了我试图调用的所有函数。
我已经从github安装了ev3dev2,并从它的网站安装了ev3的官方SD卡镜像文件。
代码:
#!/usr/bin/env pybricks-micropython
from ev3dev2.led import Leds
Leds().animate_stop错误:
Traceback (most recent call last):
File "/home/robot/ttt/main.py", line 5, in <module>
AttributeError: 'Leds' object has no attribute 'animate_stop'发布于 2020-08-07 03:08:15
试试这个:
#!/usr/bin/env pybricks-micropython
from ev3dev2.led import Leds
leds = Leds()
leds.all_off()https://stackoverflow.com/questions/60141260
复制相似问题