We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc90899 commit 2a2ff87Copy full SHA for 2a2ff87
1 file changed
BLE_Apple_Watch_Controller/code.py
@@ -85,14 +85,14 @@
85
# while BLE connected
86
while ble.connected:
87
position = encoder.position
88
- # if the encoder is turned to the right
89
- if position > last_position:
90
- kbd.send(Keycode.RIGHT_ARROW)
91
- # if the encoder is turned to the left
92
- if position < last_position:
93
- kbd.send(Keycode.LEFT_ARROW)
94
- # reset encoder position
95
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
96
last_position = position
97
print(f"Position: {position}")
98
for b in range(5):
0 commit comments