添加测试代码,防止程序退出

This commit is contained in:
2026-03-02 11:15:14 +08:00
parent c20c750635
commit 7ea779acc8
4 changed files with 20 additions and 0 deletions

View File

@ -213,4 +213,13 @@ def cleanup():
if __name__ == '__main__':
align_wire(speed=2500, cycle=10.0)
time.sleep(10) # 电机运动需要的时间
# 测试是否电机能停止
motor_start(speed=2500, cycle=5.0, direction=0)
time.sleep(1) # 电机运动需要的时间
motor_stop()
time.sleep(0.2)
while(True): # 防止程序退出
time.sleep(1)