updated to use new descriptive button names

This commit is contained in:
John Edgar Park 2019-02-05 21:58:32 -08:00
parent a774199262
commit 192d61a289

View file

@ -50,13 +50,13 @@ while True:
if isinstance(packet, ButtonPacket):
if packet.pressed:
red_led.value = True
if packet.button == '5' and angle != UP_ANGLE:
if packet.button == ButtonPacket.UP and angle != UP_ANGLE:
# The Up button was pressed.
for a in range(angle, UP_ANGLE+1, 1):
crickit.servo_1.angle = a
angle = UP_ANGLE
elif packet.button == '6' and angle != DOWN_ANGLE:
elif packet.button == ButtonPacket.DOWN and angle != DOWN_ANGLE:
# The Down button was pressed.
for a in range(angle, DOWN_ANGLE-1, -1):
crickit.servo_1.angle = a