Andre Garzia
I am a software developer and technologist from Niteroi, Brazil working on resources for unlocking new digital skills across the world.
-- configurando o pino D1 para saída de dados.
pin = 1
gpio.mode(pin, gpio.OUTPUT)
-- Liga um temporizador de 1 segundo que pisca o LED.
function pisca()
local timer = tmr.create()
local aceso = false
timer:register(1000, tmr.ALARM_AUTO, function(t)
gpio.write(pin, aceso and gpio.HIGH or gpio.LOW)
aceso = not aceso
end)
timer:start()
end
By Andre Garzia
Um workshop sobre IoT com NodeMCU e Lua
I am a software developer and technologist from Niteroi, Brazil working on resources for unlocking new digital skills across the world.