Electronic – arduino – 7-color RGB LED Help

arduinoledrgb

I bought a 3 legged Blinking (I have a theory this might be my problem) RGB LED from Radio Shack. I am not quite sure on how to code my arduino to make it emit one solid color constantly.

The closest I have gotten was by restricting the flow of voltage to the LED via resistors but it seems a little bit inefective. I have looked on the interent to find coding examples but winding up with results that do not match my problem.

I wou ld like to be able to control the color by means of coding, I am just not sure of how to code it.

Any help, coding or pointing me in the right direction is appreciated.

Best Answer

Can you link to the item in question? If it was advertised as a "Blinking LED" then it's likely it is a small module that is set up to blink as standard (i.e. you don't have to toggle power)

Blinking LED

If what you have is something like this Radio Shack Blinking LED then I think this may be the case. If you need to have more control over things then I would simply buy a standard RGB LED.

EDIT - just found this manual (actually written by someone who experimented a bit with them - the practically useless datasheet is here) with operation instruction linked to from one of the comments. It seems it can be toggled through various modes (including continuous on) by switching the mode pin to ground.
Here is an example circuit from the manual:

Blinking LED Circuit

The "manual" says you must use a low enough value resistor to prevent the LED continually resetting. See the last page of the manual, apparently this happens when run under ~10mA, so make sure you are running above this.
It says on power up it should cycle through the colours 4 times then stop with red LED lit.

I would aim for between 15mA and 25mA.
The LED typical forward voltage is 3.2V, so if you are running it from a 9V supply and want 20mA, use a (9V - 3.2V) / 0.025A = 290Ω (270Ω or 300Ω will do)
For a 5V supply, you would use (5V - 3.2V) / 0.020A = 90Ω (100Ω or 82Ω will do)

If it still won't work, post a picture/schematic of your setup with supply voltage and resistor value.