This commit is contained in:
Christian Zufferey
2019-02-28 12:29:20 +01:00

26
Btn/btn_led2.lua Normal file
View File

@@ -0,0 +1,26 @@
-- Programme qui allume ou étiend (flip-flop) la led bleue quand on appuie le bouton flash
print("btn_led2.lua aj190226.1649")
gpio.write(0,1)
gpio.mode(0,gpio.OUTPUT)
gpio.mode(3,gpio.INT)
d=tmr.now()
function zled (a,b,c)
print("a: "..a..",b: "..b..",c: "..c)
if b-d > 300*1000 then
if gpio.read(0) == 0 then
gpio.write(0,1)
else
gpio.write(0,0)
end
print(gpio.read(0))
d=b
end
end
gpio.trig(3, "down", zled)
print("tutu")