
Two color LED module
Two color LED module for Arduino, emits red and green light. You can adjust
the amount of each color using PWM.
This module consist of a common cathode 3mm or 5mm red/green LED.
Since operating voltage is 2.0v ~2.5V, you'll need to use limiting resistors to
prevent burnout when connecting to the Arduino.
Pinout and Connection to Arduino
We'll use a couple of 330Ω resistors to limit the current from the Arduino and prevent burning the
LED.

Arduino Example Sketch
The following Arduino sketch will gradually alternate between red and green color.
int redpin = 11; // pin for red signal
int greenpin = 10; // pin for green signal
int val;
void setup() {
pinMode(redpin, OUTPUT);
pinMode(greenpin, OUTPUT);
}
void loop() {
for(val = 255; val > 0; val--) {
analogWrite(redpin, val); //dim red
analogWrite(greenpin, 255 - val); // brighten green
delay(15);
}
for(val = 0; val < 255; val++) {
analogWrite(redpin, val); //brighten red
analogWrite(greenpin, 255 - val); //dim green
delay(15);
}
}