0

我目前正在使用来自乐高的官方 EV3 Python 来编写 Mindstorm EV3。当我跑

while 1==1:

    print(ColorSensor(Port.S2).reflection())
    wait(100)

它工作了一段时间,给了我来自光传感器的数据,但大约 15-45 秒后,它崩溃了

Traceback (most recent call last):
  File "/home/robot/curtin2/main.py", line 63, in <module>
  File "pybricks/ev3devio.py", line 64, in __init__
  File "pybricks/ev3devio.py", line 70, in _open_files
  File "pybricks/ev3devio.py", line 50, in get_sensor_path
OSError: No such sensor on Port S2
Remote process ended due to signal: Segmentation fault
----------
Exited with error code 1.

当传感器还在那里时,它就好像传感器已经消失了一样。有谁知道吗?编辑:它在第 250 次传感器检查时崩溃,这是内存问题吗?尝试了不同的电缆和不同的传感器

4

0 回答 0