-->
Page 1 of 1

PANIC: unprotected error in call to Lua API (attempt to call

PostPosted: Thu Dec 07, 2017 2:01 pm
by TJH
Why do I continually get this error with this code ?
PANIC: unprotected error in call to Lua API (attempt to call a string value)
The code runs for about 30 seconds without error , then I start getting this error

Code: Select all--local gpio0 = 3
--local gpio2 = 4
local gpio4 = 2
local ledPin = 4

--gpio.mode(gpio0, gpio.OUTPUT)
gpio.mode(ledPin, gpio.OUTPUT)

lighton=0
tmr.alarm(0,100,1,function()
if lighton==0 then
    lighton=1
    --gpio.write(gpio0, gpio.LOW)
    gpio.write(ledPin, gpio.HIGH)
else
    lighton=0
    --gpio.write(gpio0, gpio.HIGH)
    gpio.write(ledPin, gpio.LOW)
end
end)

print("Blinking")

-- tmr.stop(0)