本文整理汇总了Python中PyMata.pymata.PyMata.get_stepper_version方法的典型用法代码示例。如果您正苦于以下问题:Python PyMata.get_stepper_version方法的具体用法?Python PyMata.get_stepper_version怎么用?Python PyMata.get_stepper_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyMata.pymata.PyMata
的用法示例。
在下文中一共展示了PyMata.get_stepper_version方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from PyMata.pymata import PyMata [as 别名]
# 或者: from PyMata.pymata.PyMata import get_stepper_version [as 别名]
signal.signal(signal.SIGINT, signal_handler)
# send the arduino a firmata reset
firmata.reset()
# configure the stepper to use pins 9.10,11,12 and specify 512 steps per revolution
firmata.stepper_config(512, [12, 11, 10, 9])
# allow time for config to complete
time.sleep(.5)
# ask Arduino to return the stepper library version number to PyMata
firmata.stepper_request_library_version()
# allow time for command and reply to go across the serial link
time.sleep(.5)
print("Stepper Library Version",)
print(firmata.get_stepper_version())
# move motor #0 500 steps forward at a speed of 20
firmata.stepper_step(20, 500)
# move motor #0 500 steps reverse at a speed of 20
firmata.stepper_step(20, -500)
# close firmata
firmata.close()