本文整理汇总了Python中motor.Motor.stop_bot方法的典型用法代码示例。如果您正苦于以下问题:Python Motor.stop_bot方法的具体用法?Python Motor.stop_bot怎么用?Python Motor.stop_bot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类motor.Motor
的用法示例。
在下文中一共展示了Motor.stop_bot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: navigate
# 需要导入模块: from motor import Motor [as 别名]
# 或者: from motor.Motor import stop_bot [as 别名]
def navigate():
'''
Function will call exploration() function to move robot, but will keep
track of previous moves
'''
# Test output
print("Navigating ...")
# Create motor and buzzer objects
motor = Motor()
buzzer = Buzzer()
# Beep to indicate begining of navigate step
buzzer.play(4)
try:
# Enter the exploration loop
for i in xrange(params.p['MAX_ITER']):
# Execute explore function and save results
explore(motor, buzzer)
# Wait between moves
time.sleep(params.p['WAIT_TIME'])
except Exception:
pass
finally:
motor.stop_bot()