- Fri Nov 25, 2016 7:42 pm
#58685
Having a problem with for next loop on an esp-01 (1 meg black pcb, 8 pins). I a simply trying to flash a neopixel connected to pin 2. When I use the x = x + 1 loop, the unit works perfectly, however when I use a for-next loop to do the same thing, it does not flash the neopixel, but it does seem to run as I get "done" after a short period of time. Any ideas would be useful. I understand that the 1 meg is a "cut down" version, but the for-next should work I think...
First version of code that works fine...
Code: Select allneo.setup(2)
x = 0
[start]
neo(0,255,0,0)
delay 200
neo(0,0,0,0)
delay 200
x = x + 1
if x = 10 then end
goto [start]
This one does not work, but seems to run (no flashing, but gets "done" after a bit...
Code: Select allneo.setup(2)
for x = 0 to 10
neo(0,255,0,0)
delay 200
neo(0,0,0,0)
delay 200
next x
end