本文整理汇总了Python中motor.Motor.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Python Motor.shutdown方法的具体用法?Python Motor.shutdown怎么用?Python Motor.shutdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类motor.Motor
的用法示例。
在下文中一共展示了Motor.shutdown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Motor
# 需要导入模块: from motor import Motor [as 别名]
# 或者: from motor.Motor import shutdown [as 别名]
from motor import Motor
motor1 = Motor(18, 4, 17, 23, 24)
motor2 = Motor(18, 22, 27, 18, 25)
if __name__ == "__main__":
while True:
delay = raw_input("Delay between steps (milliseconds, or -1 to quit)? ")
if delay == "-1":
break
motor1.setDelay(int(delay))
motor2.setDelay(int(delay))
steps = raw_input("How many steps forward? ")
motor1.forward(int(steps))
motor2.forward(int(steps))
motor1.backwards(int(steps))
motor2.backwards(int(steps))
motor1.shutdown()
motor2.shutdown()