Introduction: Multicoloured LED Light
This is a very simple Arduino project. It is powered by the Arduino UNO. This is a suitable project for beginners and the result is pretty cool. All you need is an arduino, usb connectivity, wires, 220 ohm resistors, an RGB LED and optional breadboard.
Step 1: Gather Components Needed.
You will need:
- Arduino with USB connectivity
- RGB LED
- 220 ohm resistors
- wires and a breadboard
- Arduino with USB connectivity
- RGB LED
- 220 ohm resistors
- wires and a breadboard
Step 2: Get Power
To give your breadboard power, connect the 5v and GND pins on your arduino to the + and - on the side of the breadboard respectively. Then attach one wire from - on the same side of the breadboard to + on the other side. Both sides of the breadboard now have power.
Step 3: Wire It Up
Connect the - row on the breadboard to the longest leg of the LED which is ground. Then connect the other 3 legs of the LED to digital pins 11, 10 and 9 through 220 ohm resistors. Make sure that every leg is connected via a 220 ohm resistor.
Step 4: Code
This is the code I wrote. Feel free to copy. You can make the LED light up with primary colours or secondary colours of light. Here are the combinations:
Red = Only ledR is HIGH
Blue = Only ledB is HIGH
Green = Only ledG is HIGH
Cyan = Only ledG and ledB are HIGH
Yellow = Only ledG and ledR are HIGH
Magenta = Only ledB and ledR are HIGH
Red = Only ledR is HIGH
Blue = Only ledB is HIGH
Green = Only ledG is HIGH
Cyan = Only ledG and ledB are HIGH
Yellow = Only ledG and ledR are HIGH
Magenta = Only ledB and ledR are HIGH