Hello, I am trying to use the shiftPWM library to control 8 rgb leds.
I have 2 problems:
-
I want to use common anode leds, what should I do to get it work with the code?
-
my LEDs are connected in that way: BGRBGRBGRBGRBGRBGRBGRBGR. which grouping should I use?
also, I have a more general question: as soon as I am connecting all of these LEDs to the arduino it turnes off, maybe because the big load. for each of the r, g, and b pins of every LED I have a 330ohm resistor. is this value correct? in the past it worked correctly, but now the arduino just turnes off. what am I doing wrong?
Thank you for ANY help,
Arad.
- I want to use common anode leds, what should I do to get it work with the code?
Simply invert the state that turns on / off the LEDs. You will have to wire up the LEDs differently, that is by sinking the current not sourcing it.
- my LEDs are connected in that way: BGRBGRBGRBGRBGRBGRBGRBGR. which grouping should I use?
Any one you like.
as soon as I am connecting all of these LEDs to the arduino it turnes off,
Sounds like a short circuit somewhere.
have a 330ohm resistor. is this value correct?
Yes it will do.
Hello Grumpy_Mike! Thank you for you help.
Grumpy_Mike:
Simply invert the state that turns on / off the LEDs. You will have to wire up the LEDs differently, that is by
sinking the current not sourcing it.
What do you mean by that? what I did is just connect the anode to the 5v terminal of arduino.
Grumpy_Mike:
Sounds like a short circuit somewhere.
Do you have any tips to diagnosing? maybe it caused by the way I connected the LEDs? the registers are connected exactly like the way shown in the official arduino tutorial about the subject.
What do you mean by that? what I did is just connect the anode to the 5v terminal of arduino.
Yes, the anode to 5V, then cathode to resistor and other end of the resistor to the output. When the output is low then that causes current to flow to ground through the output. This is called sinking the current. The opposite is where the current comes from the output into the load which is connected ( through a resistor ) to the ground, or sourcing current.
maybe it caused by the way I connected the LEDs?
Not likely. Post a picture of your wiring and we can see if we can spot it.
Do you have any tips to diagnosing?
Strip out as many connections as you can until it stops shorting out and then add in the wiring, bit by bit. Remember never do any wiring with the system powered up.