LEDs With Controllable Color
This packet shows how to control an “RGB LED”, i.e., and LED whose color can
be controlled by varying the voltage applied to its pins.
An RGB LED contains 3 different LEDs in one housing: one each for the red, green,
and blue light. The brightness of each LED can be changed by changing the voltage
of one of its pins. By varying the voltage on all three LEDs within an RGB LED,
it is possible to generate millions of different colors.
For example, if a microcontroller turns “on” the red LED component with maximum
voltage, and turns “on” the blue component with maximum voltage, but leaves the
green LED turned off, then the RGB LED will emit light with a purple color
+ blue). Turning on the red and green LEDs but leaving off the
blue LED generates a yellow light. Turning on all 3 LEDs at maximum brightness
should create a white light. Turning on any combination of the 3 LEDs to some
intermediate brightness can produce any of millions of colors.