function switchread()
if (gpio.read(3)==0) then
print("pressed!!")
dofile("Mini_web.lua")
else print("not!")
end
-- print(gpio.read(3))
end
tmr.alarm(4,10,1,switchread) It does not work; the main program keeps running, but seems to do nothing when I press the switch.
BUT, if I run just the above segment, it works fine, calling the file 'Mini_web", and executing it.
I'm sure I'm doing something incredibly stupid here. Any idea what it could be?
Thanks!