Hi everyone,
As my username states I am new to Arduino. I wrote a sketch that grabs RGB color codes from a PHP website, and then uses the RGB code to turn on red, green, and blue LED lights on the Arduino.
The Arduino is hooked up to an Aysnc WiShield which allows the Arduino to connect directly to my wireless router. The Arduino successfully reads and parses my website to isolate an RGB color code (and a second number which will be used later to make the LEDs "pulse" but that's not important now).
My problem is that once I've already successfully parsed and isolated the RGB color code, I cannot make my LED lights come on. Here's my sketch, I think the problem lies somewhere in the printData function or ConvertStringtoRGB function (where I try to turn on the lights using analogWrite):
Here's the output in the Serial monitor of the code above, which works great in that it shows I've successfully parsed the website and put the RGB color code into the String strColor:
Request #1 sent at 45 seconds.
19f1ff
R:1 G:159 B:31
0
Request #2 sent at 105 seconds.
386aff
R:3 G:134 B:176
0
Request #3 sent at 165 seconds.
ffc801
R:15 G:252 B:128
0
The problem is that once I UNCOMMENT the 3 analogWrite functions at the bottom of ConvertStringToRGB the Arduino gets stuck after the first Request. The output in the Serial monitor looks like this below and the LED lights do come on according to the RGB color code just ONCE, but the program doesn't move on to Request #2 like the earlier output. There's just no more output in the Serial monitor so I think the program is STUCK?
Request #1 sent at 45 seconds.
19f1ff
R:1 G:159 B:31
0
How do I successfully light up my LED lights according to the RGB code in strColor every 60 seconds? (Btw, the LEDs are physically fine, I checked them all out with other sketches and all 3 are capable of lighting up). Please help! I've been stuck on this problem for days! :~