First off all, hello ladies and gentleman.
I am a new commer to this world, i understand a bit of programming languages and logics, but i am struggling with a problem connecting a LED strip that i bough on a store, with a 5v charger( that also means i can use it from arduino directly ( i think).
Those fotos shows as 4.5 Volts, but my is 5v!
My problem is:
http://postimg.org/image/47ge3uu9d
(in case the link is dead for “some reason” you can find it also here)
is shows 4 inputs, 5v, R, G, and B.
i connect 5V to 5V from arduino, and i am using the R G B as a “way” to ground through arduino… ( maybe this is my failure here, i don´t know)
everything is working with my code, BUT, it turns just ON or OFF, and the analogWrite is working on the oposite as it should… for example if i write
analogWrite(LED_G,255);
it turns OFF
and
analogWrite(LED_G,0);
it turns ON
which in someway makes sence… “someway” because it is connected on the oposite…
anyway, i didnt though this could be a big issue, until i decided to try to make colours using the dim of the LED…well… it just doesn´t work… well… kind of
-
Serial.println(“More”);*
-
Serial.println(“255”);*
analogWrite(LED_G,255); LED turns OFF ( if on)
Serial.println(analogRead(LED_G)); shows 1022 on SERIAL -
delay(1000);*
-
Serial.println(“0”);*
analogWrite(LED_G,0); LED IS ACTUALLY ON
Serial.println(analogRead(LED_G)); shows 334 on SERIAL -
delay(1000);*
-
Serial.println(“125”);*
analogWrite(LED_G,125); LED IS ACTUALLY ON
Serial.println(analogRead(LED_G)); ** shows 335 on SERIAL** -
delay(1000);*
-
Serial.println(“150”);*
analogWrite(LED_G,150); LED IS ACTUALLY OFF
Serial.println(analogRead(LED_G)); shows 1021 on SERIAL -
delay(1000);*
-
Serial.println(“200”);*
analogWrite(LED_G,200); it stays always OFF after "150" -
Serial.println(analogRead(LED_G));*
-
delay(1000);*
I my best guess would be around the circuit itself and not the code… but this was already a “debug” phase…let´s call it that way.
electronics is not my real thing, so i maybe need some help on that subject.
thanks for the help guys, i already tryed to find on google help on this matter, but i am only able to find LED STRIPS with more then 5v, so its not really helpfull, because i dont want to use any kind of relays or so.
Sorry also for my english, it is not my main language.
Thanks for any help or tip.
code.txt (2.26 KB)