Colored light! (RGB LED)
Make a light shine in any color of the rainbow.
RGB LEDs come in different flavours, but can generally be connected in the same way. The color pins must be connected to PWM pins of the Arduino. The LED in this example has one pin for each red, green, and blue, but you can also get them with two blues, for example. The remaining pin must be connected to either ground (if it's a 'common cathode' type) or to power (if it's a 'common anode' type). Then just write to the PWM outputs depending on how bright you want each color component to glow.
Created on November 25, 2012, 20:45