The RGB LED has a wide range of applications, including outdoor decoration lighting, stage lighting designs, house decoration lighting, LED matrix display, and others.
In this tutorial, we will use the RGB LED to smoothly fade from one color to the next.
Connect the wires between the RGB led and the Arduino as shown in the image below.
Connections from the Arduino to the breadboard:
• Arduino pin GND → Breadboard ground line
• Arduino pin 5V → Breadboard 5V line
Connections from the RGB LED:
• Red led pin→220-ohm resistor→ Arduino pin 3
• Negative pin→ Breadboard ground line
• Green led pin→ 220-ohm resistor → Arduino pin 5
• Blue led pin→ 220-ohm resistor → Arduino pin 6
When you upload the code to your Arduino, you will notice the RGB LED rapidly fading from red to green, then to blue, and again back to red; the colors are so beautiful!