刚刚开始玩openmv,看教程写了个舵机的控制程序练习一下,结果程序运行后无法中断脚本运行,然后发生断开连接的情况,求解答
from pyb import Servo
import time,pyb
s1 = Servo(1) # servo on position 1 (P7)
led2 = pyb.LED(2)
while(1):
led2.on()
s1.angle(45) # move to 45 degrees
time.sleep(600)
s1.angle(-60, 1500) # move to -60 degrees in 1500ms
time.sleep(600)
原因:s1.angle(-60, 1500)这句话1.5秒会收不到IDE的消息。
解决办法:改为s1.angle(-60)
我测试了一下,我认为应该是固件错误。
已经提交issue。
https://github.com/openmv/openmv/issues/553
@kidswong999 提交issue是希望官方固件更新修正吗