Open twn39 opened 3 years ago
Led 闪烁:
local pin = 4
local led_timer = tmr.create()
local led_status = 0
gpio.mode(pin,gpio.OUTPUT)
led_timer:alarm(1000, tmr.ALARM_AUTO, function()
if (led_status == 0) then
gpio.write(pin,gpio.HIGH)
led_status = 1
else
gpio.write(pin,gpio.LOW)
led_status = 0
end
end)
使用 esptool 刷入固件:
init.lua