Specifications
- Red (R), green (G) and blue (B) diode in one package
- Common cathode, the brightness of each colour is controlled by PWM
- The module goes on top of the tower
- Power 3.3 V, the LEDs are driven straight from the pins
- Current ≈ 5–10 mA per colour, full white ≈ 25 mA (estimate)
- Does not use the I2C bus
- Uses: PC and gaming setups, lighting, indicators
Pins
| Pin | Function |
|---|---|
| IO5 | Red (LED_R) |
| IO6 | Green (LED_G) |
| IO7 | Blue (LED_B) |
Wiring diagram
Example code
Try the example Rainbow lamp right in your browser in Eduingo AI Lab. The RGB LED shows all the colours of the rainbow one after another: red, orange, yellow, green, blue and purple, and then starts again. A colour is given as a code like #ef4444: the first two characters after the hash are red, the next two green and the last two blue. Try adding pink or making the rainbow faster.