- This DIY electronic light is a good example of working with PWM pins.
- The rainbow colours are achieved by maximising and minimising the values of the individual LEDs, which we do using a for loop.
- With the colourToLED function we send the respective value to the LEDs.
- The wiring is as simple as it gets. The light runs on an ATtiny25.
- We added three 3mm LEDs in red, green and blue to mimic the RGB LEDs and added 100 Ω resistors for the LEDs.
- The light is powered by a button cell battery.
Get the Case: Thingiverse
You like it? Then I would be very happy if you treat me to a coffee on ko-fi.com/pixeledi