我一直在这行代码上出错,如何解决?先谢谢你
tmr.alarm(0, 250, tmr.ALARM_AUTO, function()
你显然是在使用某个地方的过时的例子片段。这里没有 tmr.alarm
计时器模块中的功能。
参见 https:/nodemcu.readthedocs.ioenlatestmodulestmr。 以获取当前的API文档。有一个 alarm()
计时功能 对象 即你首先需要创建一个定时器对象。下面的例子是直接从文档中找到的。
if not tmr.create():alarm(5000, tmr.ALARM_SINGLE, function()
print("hey there")
end)
then
print("whoopsie")
end