Full-Color LED

Status
Not open for further replies.

Burtamus

Member
I've been building the landing gear and Com1 examples with Teensy 2.0. Love playing with the coding and the hardware.

I got everything working but purchased some RGB LED's so I could have only one set of LED's instead of the yellow and the green ones in the sample.

I purchased Radio Shack's 276-0028 - "5mm High Brightness Full-Color LED". However, they did not work. Come to find out, they have a common anode. In testing, I have VCC -> Resistor -> common and then jump blue leg to GND and it works. Jump green leg to GND and it works. Same with the green leg.

So my question is, can I drop a teensy pin to ground to turn each one on? An easy solution is to find an RGB LED with a common cathode but I thought I'd check here first.

BTW, I am not an electronics type of guy and this is my first dive into hardware.

Thanks in advance.
 
Sure, you just reverse your logic. Turn on the LED with digitalWrite(pin, LOW) to turn it on and digitalWrite (pin, HIGH) to turn it off.
 
Status
Not open for further replies.
Back
Top