pyfirmata停止伺服控制

时间:2016-02-14 17:48:10

标签: python firmata

我有一个测试脚本来验证我的伺服设置。它工作正常并结束,但我仍然听到电源进入舵机。如何停止此信号。

import pyfirmata

board = pyfirmata.Arduino('/dev/ttyACM0')
turret = board.get_pin('d:5:s')
left = board.get_pin('d:11:s')
right = board.get_pin('d:10:s')

right.write(90)
left.write(60)
time.sleep(3)
left.write(90)
time.sleep(3)
right.write(120)
time.sleep(3)
right.write(90)
time.sleep(3)

1 个答案:

答案 0 :(得分:-1)

您需要通过将括号中的值切换回0来关闭它。

right.write(0)
left.write(0)