i have this LED knob light and I wanted to do some modifications with it via Arduino. I set up the RBG wires to the Arduino but whenever I send a LOW signal, it will turn the light on and when I send a HIGH signal it turns it off. The same goes with analog from 0-255. Can anyone tell me why this happens and how to fix it? Thank you.
How is your LED wired?
You need to make a simple drawing showing how you have everything connected and post a photo of the drawing. See this Simple Image Guide
I sounds like you have something connected the wrong way.
On the other hand, if it works and you can adjust your code to accommodate it ....
...R
If you wire a LED (plus resistor) between Vcc and the pin and make that pin HIGH, both side of the LED/resistor have the same voltage (e.g. 5V) and no current will flow and the led will be off.
Making the pin LOW and there will be a 5V difference over the LED/resistor and current will flow and the LED will be on.
Whenever I try to modify the post and upload the pics, I get this message:
"413 Request Entity Too Large". I guess I'll just adjust my code so that it works with the reverse convention but is this issue common?
Can you reduce the size of the images? 640 x 480 should be plenty big enough.
...R
Ok i added the pics in (sorry they are kinda bad)
Briskgotmethrough:
Ok i added the pics in (sorry they are kinda bad)
None of them is a drawing showing the connections. I find it impossible to be certain of connections from photos of the hardware.
...R
A regular (single) LED can be wired either way, so high is on or so low is on.
You might simply need to invert the logic in your code (or subtract 255 from your PWM values).
A properly wired common-anode RGB LED will have the anode connected to +5V with the 3 output pins connected to the 3 cathodes through 3 current limiting resistors. When the output goes low, the LED turns-on.
A common cathode RGB LED should be wired the other way (common cathode to ground) and high will turn the LED(s) on.
If you can control the LEDs individually, I'm guessing everything is wired correctly and your software is "backwards".
DVDdoug:
You might simply need to invert the logic in your code (or subtract 255 from your PWM values).
sp. "subtract your PWM values from 255"
Ok so I just ended up subtracting 255 from the values so that I can still use the normal convention. Thanks!
Briskgotmethrough:
Ok I added the pics in (sorry they are kinda bad)
Yes. Always take the parts out into full daylight - but not full sun - to take photos. Preferably using a real camera.