I've bought a bunch of RGB LEDs, and based on the attached diagram, it looks like the LEDs are common ANODE. I am looking to use an ATMEGA328 just to try out if I can pulse the Red, Green, Blue LEDs in this RGB LED via PWM.
My first question is to confirm that the RGB LED is indeed common ANODE. Is that so? Please see the attached diagram.
Below is additional information about this RGB LED. My 2nd question is: If it's indeed common ANODE, then I would have to connect this LED as an INPUT to the ATMEGA328 pins that support PWM, the OCxx pins. However, the connection would have to be configured as an INPUT, because the ATMEGA328 would have to SINK the current to turn the LED on. How would that work for pulsing the LED, since the OCxx pins would be required to setup as OUTPUT rather than INPUT, no?
Another question is that the LED will draw 20mA, or would require the ATMEGA328 to SINK 20mA. I am not sure if it's 20mA per color, that is, 20mA each for red, green, and blue LEDs or 20mA for the three. Assume it's the former, I could stick a 330ohm resistor at pin 1, the ANODE pin of the LED, to reduce the current 10mA, since an AVR can only sync 10mA max per IO pin, a total of 30mA, correct? THANKS FOR ANY HELP TIP!
Model: 1210 (3528)
· Product Dimensions: 3.5 * 2.8 * 1.9
· Voltage: 2.0-2.2V Red brightness 500-550MCD wavelength :620-625NM
· Voltage: 3.0-3.4V blue brightness 700-750MCD wavelength :460-475NM
· Voltage: 3.0-3.4V Green brightness 800-850MCD wavelength :520-525NM
· Current: 20MA
· Soldering temperature: 250
· Viewing angle: 120