I have a strange red-green led, with three wires: white -> LED+ red -> LR green -> LG As I've seen, usually the multiple color leds have one anode (+) for each color and a catode connected to ground, and all examples of connections to arduino I've found are for this polarization. So, how can I control my strange led? Where I have to pin the wires? (sorry, I'm really newbie)
If you have a “Common Anode” style of LED cluster, connect the common anode to +5. Then connect the separate cathodes to I/O pins through the same size resistor you would use if the LED was connected to Ground. Then when the pin is HIGH, no power will flow (both ends of the LED are at +5V). When the pin is LOW the LED will light up (power will flow from +5V through the LED and resistor to the LOW I/O pin.
If you use PWM outputs, 0 will be full on and 255 will be full off. Exactly the inverse of a Common Cathode cluster.
No, you can’t use a single resistor on the common pin. Each LED needs a separate current limiting resistor.
Great explanation John!! Thnaks a lot!