We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 262e47e + dad627c commit 3109848Copy full SHA for 3109848
examples/seesaw_quadrotary.py
@@ -35,9 +35,6 @@
35
print(positions)
36
for n, rotary_pos in enumerate(positions):
37
if rotary_pos != last_positions[n]:
38
- print(f"Rotary #{n}: {rotary_pos}")
39
- last_positions[n] = rotary_pos
40
-
41
if switches[n].value: # Change the LED color if switch is not pressed
42
if (
43
rotary_pos > last_positions[n]
@@ -46,6 +43,9 @@
46
else:
47
44
colors[n] -= 8 # Advance backward through the colorwheel.
48
45
colors[n] = (colors[n] + 256) % 256 # wrap around to 0-256
+ # Set last position to current position after evaluating
+ print(f"Rotary #{n}: {rotary_pos}")
+ last_positions[n] = rotary_pos
49
50
# if switch is pressed, light up white, otherwise use the stored color
51
if not switches[n].value:
0 commit comments