Corrigé le bug du timer encore une fois dans mon workshop
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
--Script de bootstrap, en appuyant sur le bouton ça démarre start_boot,
|
||||
-- autrement en attendant 8 secondes cela démarre start_boot
|
||||
|
||||
print("\n init.lua zf181017.1026\n")
|
||||
print("\n init.lua zf190808.1537\n")
|
||||
|
||||
zswitch=3 --switch flash
|
||||
gpio.mode(zswitch, gpio.INT, gpio.PULLUP)
|
||||
@@ -9,14 +9,14 @@ initalarme=tmr.create()
|
||||
|
||||
function hvbouton()
|
||||
gpio.trig(zswitch, "none")
|
||||
tmr.unregister(initalarme)
|
||||
initalarme:unregister()
|
||||
dofile("start_boot.lua")
|
||||
-- dofile("start_job.lua")
|
||||
end
|
||||
|
||||
gpio.trig(zswitch, "both", hvbouton)
|
||||
|
||||
tmr.alarm(initalarme, 8000, tmr.ALARM_SINGLE, function()
|
||||
initalarme:alarm(8000, tmr.ALARM_SINGLE, function()
|
||||
print("\nStart\n")
|
||||
dofile("start_boot.lua")
|
||||
-- dofile("start_job.lua")
|
||||
|
||||
@@ -45,6 +45,8 @@ srv:listen(80, function(conn)
|
||||
elseif (_GET.pin == "OFF") then
|
||||
_off = " selected=\"true\""
|
||||
gpio.write(zLED, gpio.HIGH)
|
||||
elseif (_GET.pin == "zuzu") then
|
||||
print("hello zuzu")
|
||||
end
|
||||
buf = buf .. "<option" .. _off .. ">OFF</option><option" .. _on .. ">ON</option></select></form></body></html>"
|
||||
client:send(buf)
|
||||
|
||||
5
Workshop/181015/btn_led_remote/led/wifi_cli_conf.lua
Normal file
5
Workshop/181015/btn_led_remote/led/wifi_cli_conf.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
-- Petit script pour configurer le client WIFI du NodeMCU
|
||||
print("\n wifi_cli_conf.lua zf190808.1559 \n")
|
||||
|
||||
wifi.sta.config{ssid="3g-s7", pwd="12234567", save=true}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
-- Petit script pour obtenir l'adresse IP du NodeMCU connecté sur un AP Wifi
|
||||
print("\n wifi_get_ip.lua zf180824.2000 \n")
|
||||
print("\n wifi_get_ip.lua zf190808.1600 \n")
|
||||
|
||||
wifitimer1=tmr.create()
|
||||
tmr.alarm(wifitimer1, 1000, tmr.ALARM_AUTO , function()
|
||||
wifitimer1:alarm(1000, tmr.ALARM_AUTO , function()
|
||||
if wifi.sta.getip() == nil then
|
||||
print("Connecting to AP...")
|
||||
else
|
||||
tmr.stop(wifitimer1)
|
||||
wifitimer1:stop()
|
||||
dofile("wifi_info.lua")
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user