logo

使用IDE运行舵机控制程序时会发生断开链接的情况

2019-07-19 14:40
U
s1ti

刚刚开始玩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)
845ff8df-6dca-4d40-93b3-e9ed1d78ca83.png
2019-07-19 15:43
I
网红小智智 星瞳科技

原因:s1.angle(-60, 1500)这句话1.5秒会收不到IDE的消息。

解决办法:改为s1.angle(-60)

2019-07-19 16:10
I
网红小智智 星瞳科技

我测试了一下,我认为应该是固件错误。

已经提交issue。

https://github.com/openmv/openmv/issues/553

U
s1ti

@kidswong999 提交issue是希望官方固件更新修正吗