Raspberry Pi practice problem · LEDs & PWM
Mixing colours
EasyBudget $5Python · gpiozero
Two primaries make a secondary colour. An RGB LED (common cathode) has red on GPIO17, green on GPIO27 and blue on GPIO22, each with its own resistor. Show:
- yellow (red + green) from 0 to 1 s
- cyan (green + blue) from 1 to 2 s
- magenta (red + blue) from 2 to 3 s
- repeat
Each colour uses its two channels fully on and the third off.