本文整理汇总了Python中Camera.stop方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.stop方法的具体用法?Python Camera.stop怎么用?Python Camera.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: import Camera [as 别名]
# 或者: from Camera import stop [as 别名]
def test():
# Rover init
RM.port_init()
RM.motor_gpio_init()
RM.print_port_info()
# Servor init
CM.servo_init()
CM.move_to_center()
while True:
cmd = raw_input("command, l/r/s or fx or bx x is second:, u-up,d-down")
if cmd[0] == "r":
if len(cmd) == 1:
speed = 8
else:
speed = int(cmd[1])
RM.turn_right_speed(speed)
elif cmd[0] == "l":
if len(cmd) == 1:
speed = 8
else:
speed = int(cmd[1])
RM.turn_left_speed(speed)
elif cmd[0] == "f":
if len(cmd) == 1:
speed = 8
else:
speed = int(cmd[1])
RM.move_forward_speed(speed)
elif cmd[0] == "b":
if len(cmd) == 1:
speed = 8
else:
speed = int(cmd[1])
RM.move_backward_speed(speed)
elif cmd[0] == "s":
RM.move_stop()
CM.stop()
elif cmd[0] == "u":
CM.move_up(0.5)
elif cmd[0] == "d":
CM.move_down(0.5)
elif cmd[0] == "q":
RM.move_stop()
CM.stop()
print "BYE"
exit(1)
else:
exit(1)