0

我有一个测试脚本来验证我的伺服设置。它工作正常并结束,但我仍然听到伺服系统通电。我如何停止这个信号。

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)
4

1 回答 1

-1

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

right.write(0)
left.write(0)
于 2016-11-11T15:32:56.150 回答