Skip to content

Commit dbbde6c

Browse files
committed
Document how to access all the LEDs together
I've left out that it's possble to access individual LEDs in the mapping using the `KCHLED` enum for a couple of reasons: - I don't know if we're going to explose that enum, and - it's probably better that we document only a single way to access the LEDs, to encourage consistency between teams
1 parent fb78f03 commit dbbde6c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

programming/sr/leds/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,15 @@ R.kch.c.rgb = (1, 1, 0)
4747
# Set LED B to a light blue colour
4848
R.kch.b.rgb = (0, 1, 1)
4949
~~~~~
50+
51+
You can also access all the LEDs together:
52+
53+
~~~~~ python
54+
# Turn on the blue channel of all the LEDs
55+
for led in R.kch.leds.values():
56+
led.blue = 1
57+
58+
# Set all LEDs to a purple colour
59+
for led in R.kch.leds.values():
60+
led.rgb = (1, 0, 1)
61+
~~~~~

0 commit comments

Comments
 (0)