User Manual

51
/
223
Component Introduction
RGB:
At first glance, RGB (Red, Green and Blue) LEDs look just like regular LEDs. However,
inside the usual LED package, there are actually three LEDs, one red, one green and
yes, one blue. By controlling the brightness of each of the individual LEDs you can
mix pretty much any color you want.
We mix colors the same way you would mix paint on a palette - by adjusting the
brightness of each of the three LEDs. The hard way to do this would be to use
different value resistors (or variable resistors) as we did with in Lesson 2, but that's
a lot of work! Fortunately for us, MEGA2560 R3 board has an analogWrite function
that you can use with pins marked with a ~ to output a variable amount of power to
the appropriate LEDs.
The RGB LED has four leads. There is one lead going to the positive connection of
each of the single LEDs within the package and a single lead that is connected to all
three negative sides of the LEDs.