- In the RGB LED, 3 small LEDs are combined in the colours red, green and blue.
- Therefore we have to declare the pins for each colour of the LED.
- We also declare the pin for the push button and some variables for debouncing the push button
- The function colourToLed sets the brightness value of each small LED in the RGB LED.
- In the loop, we debounce the push button and count the detected button presses so that we can perform different actions each time the button is pressed.
- For this project we use an ATtiny25 and two RGB LEDs with a common cathode.
- We added three 100 Ω resistors (one for each colour) and a 10k Ω resistor for the push button.
- The keychain 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