Files
NodeMCU_Lua/Workshop/200303/script2.lua
Christian Zufferey 409f6dae74 wip
2020-04-16 15:51:02 +02:00

25 lines
532 B
Lua

-- Programme qui allume la led bleue quand on appuie le bouton flash
-- zf181011.1749
print("\n btn_led.lua zf200302.2356 \n")
zledbleue=0 --led bleue
zswitch=3 --switch flash
gpio.mode(zswitch, gpio.INT, gpio.PULLUP)
function zbtn()
if gpio.read(zswitch)==0 then
zled_state="ON"
gpio.write(zledbleue, gpio.LOW)
else
zled_state="OFF"
gpio.write(zledbleue, gpio.HIGH)
end
print("btn_led: "..zled_state)
--disp_send()
end
gpio.trig(zswitch, "both", zbtn)