RGB LED fading through the colours on an Uno R3
5 parts
An RGB LED on an Uno R3 fades through the colours: the simulation shows its lens turn red, yellow, green, cyan, blue and magenta. One cycle takes 7.2 seconds. Each die has its own resistor, chosen from the maker's sheet for 20 mA: 150 Ω for the red on D9, and 82 Ω for the green on D10 and the blue on D11. The board's pins drop some of the 5 V, so at full duty the red draws 17.5 mA, the green 16.4 mA and the blue 16.5 mA. The sketch raises one colour's PWM as it lowers the one before, and the lens shows the mix of the three dice by their average currents. Select the LED to see each die's fit to its sheet.
- U1 Uno R3, uno_rgb_fade.ino.hex
- LED1 RGB LED
- R1 Resistor, 150Ω
- R2 Resistor, 82Ω
- R3 Resistor, 82Ω