我对NodeMCU有一个问题,我试图在esp8266上启动一个tmr.alarm。
tmr.alarm从不启动计时器,并且总是返回false。我试着改变定时器,甚至改变闹钟的类型(自动,单机.)但我总是有同样的结果。
下面是代码的一部分,我试图每5秒左右与DS18B20 (OneWire温度传感器)合并一次。
if not tmr.alarm(1, 5000, tmr.ALARM_AUTO, function()
-- Comunication with the sensor
end)
then print("Comunication with DS18B20 couldn't be started.") end输出总是
Comunication with DS18B20 couldn't be started.发布于 2016-06-10 11:05:04
不要使用来自NodeMCU的旧0.9.x https://github.com/nodemcu/nodemcu-firmware/releases二进制文件--它们不再受支持,并且包含许多bug。构建自定义固件来自dev或master分支。
我不知道在最近的版本中有任何计时器错误。
https://stackoverflow.com/questions/37744863
复制相似问题