Go Down

Topic: [SOLVED] Control red-green led (inverted?) (Read 531 times) previous topic - next topic

pakomail

Jan 27, 2012, 01:50 am Last Edit: Jan 27, 2012, 07:01 pm by pakomail Reason: 1
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)

johnwasser

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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

pakomail


Go Up