Skip to content

Commit

Permalink
Update code.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BlitzCityDIY committed Nov 20, 2024
1 parent dc90899 commit 2a2ff87
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions BLE_Apple_Watch_Controller/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@
# while BLE connected
while ble.connected:
position = encoder.position
# if the encoder is turned to the right
if position > last_position:
kbd.send(Keycode.RIGHT_ARROW)
# if the encoder is turned to the left
if position < last_position:
kbd.send(Keycode.LEFT_ARROW)
# reset encoder position
if position != last_position:
# if the encoder is turned to the right
if position > last_position:
kbd.send(Keycode.RIGHT_ARROW)
# if the encoder is turned to the left
if position < last_position:
kbd.send(Keycode.LEFT_ARROW)
# reset encoder position
last_position = position
print(f"Position: {position}")
for b in range(5):
Expand Down

0 comments on commit 2a2ff87

Please sign in to comment.