My question is regarding the hookup of a radioshack bright rgb anode led. I have the led common going to a 5v supply and the other pins are going through a 330ohm resistor to 3 PWM output pins (9,10,11 on the Arduino Uno). I set the pinMode() on each pin to OUTPUT, and then I do a "analogWrite(RED_PIN, 255);" and set the other color pins at zero. It should be red, instead it's dark purple. If I do a "digitalWrite(RED_PIN, LOW);" the red led is fully lit. My question is why is the digitalWrite() working and the analogWrite() not? I am new to electronics so excuse me if I used the wrong terminology, I'll do my best to clarify.
Electronic – arduino – Anode RGB LED Arduino Hookup
arduinodiodesled
Related Topic
- Electronic – RGB LED brightness levels
- How to adjust red brightness on MAX7219 with RGB LED
- Electronic – arduino – Why must resistors be on the respective anode terminals instead of the common cathode terminal of a RGB LED
- Choose the right resistor for your RGB led (calibrate the colors)
- Electrical – Issues with NPN Transistors and RGB LEDs (Common Anode)
- Electrical – ATmega328p driving RGB LED WS2801
- Electrical – Very dim RGB LED strip when using MOSFET
- Electrical – Driving a Common Anode RGB LED Using a uC
Best Answer
Setting the PWM duty cycle to 255 is the opposite of the digital write with low. The duty cycle of 255 means the pin is driven high (5v) 100% of the time. I suspect if you reverse your logic of the Analog writes you will get your intended results.