I'm trying to use "while loops" on esp8266 relay switch to turn on for a set period of time then off.
with this code:
gpio.write(led1, gpio.HIGH);
loop=1
while loop<=6000000 do
print(loop)
loop=loop+1
end
--elseif(_GET.pin == "OFF1")then
gpio.write(led1, gpio.LOW);
it doesn't work, no mater what the value is led turns off at about 4 seconds, even if the value is 60000000000 or more.
Right now I'm using tmr.delay which has two problems.
One, I can't interrupt it, and two, shuts down after a long delay.
Anyone have a solution? I'm not a wiz at programing, so be kind.
Thanks,
Bill