Raspberry Pi practice problem · LEDs & PWM
Dice face
MediumBudget $12Python · gpiozero
Seven LEDs arranged like the pips on a die:
TL TR
ML C MR
BL BR
TL GPIO5, TR GPIO6, ML GPIO13, C GPIO19, MR GPIO26, BL GPIO20, BR GPIO21.
Show the faces 1, 2, 3, 4, 5, 6, each for 0.5 s starting at 0 s, then start again at 1 (at 3.0 s), forever. Use the usual die layout:
| face | lit |
|---|---|
| 1 | C |
| 2 | TL, BR |
| 3 | TL, C, BR |
| 4 | TL, TR, BL, BR |
| 5 | TL, TR, C, BL, BR |
| 6 | TL, TR, ML, MR, BL, BR |
Tip: keep a table of 7-tuples, one per face, and feed it to an LEDBoard.