This is an old revision of the document!
This scenario presents how to handle the brightness control of the tri-coloured LEDs. Both LEDs are electrically bound and cannot be controlled independently. Those LEDs have 3 colour channels, controlled independently: R (Red), G (Green) and B (Blue). Mixing of those colours creates other ones, such as pink and violet. Each R G B channel can be controlled with a separate GPIO to switch it on or off or control brightness using a PWM signal, as presented in this tutorial.
define the necessary pins and functions:
/* RGB LEDS */ #define RED_PIN 14 #define GREEN_PIN 15 #define BLUE_PIN 16 void setRGB(int red, int green, int blue);