https://nodemcu.readthedocs.io/en/master/modules/tmr/
local mytimer1 = tmr.create() function TimeFunction1()
print("1S 循环定时器")
end mytimer1:register(, , TimeFunction1) mytimer1:start() local mytimer2 = tmr.create() function TimeFunction2()
print("1S 一次定时器")
end mytimer2:register(, , TimeFunction2) mytimer2:start()
提示:
其它 (硬延时 us)
延时 100us
tmr.delay(100)
注:不建议使用.
其它 (看门狗)
启用5S看门狗
tmr.softwd(5)
喂狗
tmr.wdclr()