Files
NodeMCU_Lua/Workshop/181004/btn_led.lua
Christian Zufferey fcfe7960cd - ajouté le workshop
2018-10-05 22:15:08 +02:00

18 lines
372 B
Lua

-- Programme qui allume la led bleue quand on appuie le bouton flash
-- hv180711.1125
zledbleue=0 --led bleue
zswitch=3--switch flash
gpio.mode(zswitch, gpio.INT, gpio.PULLUP)
function bouton()
if gpio.read(zswitch)==0 then
gpio.write(zledbleue, gpio.LOW)
else
gpio.write(zledbleue, gpio.HIGH)
end
end
gpio.trig(zswitch, "both", bouton)