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.

By andre
Created on November 25, 2012, 20:45

Category: Analog

Difficulty: kids

License:  Creative Commons Attribution-Share Alike 3.0 Unported License

Tags: rgb, led, color, light

Images

Files

Fritzing Files

Links

  • Print this
© 2007 - 2011 University of Applied Sciences Potsdam