Go Down

Topic: Newbie needs some clarification on RGB led pin-outs (Read 923 times) previous topic - next topic


Hello all,
   This is my first posting to the Arduino forum. I have a couple Arduino UNOs and I'm still doing the baby steps and having all kinds of fun with LEDS of the usual two pin variety but now I'd like to tinker with the common RGB led that has 4 pins. The pinout I've gotten to work is like..

Image from mbeckler.org

I see that the 'common' lead is the + Anode and all the color leads are the - Cathodes.
In my little head, I'd normally wire the Anode to a PWM outlet and the Cathode to ground. Sure enough, when I do this, I can light one led on the RGB, or all of them at once if I route all the color pins to ground but I'm wondering, how can I build a circuit that controls the rgb leads if they are going straight to ground? Or at least intelligently control them. All of the examples I see everywhere treat their RGB leds as the complete reverse and mine simply do not run this way.

I'm sure it this is probably easy but I'm a bit perplexed.  Can I use pins 9,10,11 (on the UNO) as variably negative pins?

Feel free to ask questions, photos, diagrams anything I can help with.
Thanks in advance,
eosyn aka Dave


This Adafruit tutorial explains what to do. Although the tutorial shows a common cathode RGB LED, it explains how to wire and code a common anode one. Your idea of negative pins is not far off the mark as you'll see in the note on the page where the code is.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0


Can I use pins 9,10,11 (on the UNO) as variably negative pins?


When an Arduino pin is "LOW" it's connected to ground.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)


Cheers all for the replies! ++faith_in_humanity :)

Go Up