Zacząłem korzytać z ESP8266 i języka LUA jak na razie jest on dla mnie nie zrozumiały.
gpio.mode(4,gpio.OUTPUT)
state = 0
tmr.alarm(0, 500, 1, function()
if (state==0) then
state = 1
gpio.write(4, gpio.HIGH)
else
state = 0
gpio.write(4, gpio.LOW)
end
end)
Przykładowy kod znaleziony na stronie www. Powinien działać, a przy próbie wgrania pojawiają się takie kwiatki
stdin:1: 'then' expected near 'thenstate'
stdin:2: '=' expected near 'tate'
stdin:2: malformed number near '0tmr'
stdin:1: malformed number near '1gpio'
Używam Esplorer IDE.
JAk to ogarnąć?
<code=lua></code>