Controlling a RGB LED
In this project, you'll learn how to connect and control an RGB LED.
A RGB LED is a LED with three individual color (red, green, blue) LEDs built inside one package. By varying the brightness of each of the three LEDs, millions of colors are possible.
Parts needed:
|
| |
1 | Making the connections
The negative connection for each of the three LEDs are connected in common internally. This is the longest pin labeled cathode in the RGB LED picture.
Note that if only one resistor is used on the negative end instead of three resistors on the positive ends, then when the colors are mixed, the resulting color might not be correct because the power distribution to the three leds might be different. | |
2 | Create a new program by selecting File from the menu
Use three Setting red to 80, green to 0 and blue to 80 gives purple color. | |
3 | Upload and run the program. You should see the RGB LED showing purple color. | |