station_cfg={}
station_cfg.ssid="123456789"
station_cfg.pwd="1234567890"
station_cfg.save=false
wifi.sta.config(station_cfg)
wifi.sta.connect()
tmr.alarm(0,1000,1,function()
print(
wifi.sta.getip())
end)
這是我的代碼lua寫的,但是一直顯示
stdin:1: attempt to call field 'alarm' (a nil value)
stack traceback:
stdin:1: in main chunk
到底是怎么回事呀???
小白真心不懂。
uj5u.com熱心網友回復:
if not tmr.create():alarm(5000, tmr.ALARM_SINGLE, function()print("hey there")
end)
then
print("whoopsie")
end
“address,https://nodemcu.readthedocs.io/en/master/modules/tmr/#tmrcreate
你用老版本的韌體??
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/72588.html
標籤:無線
