Files
loustique-home/flask/bouton.py
2026-03-21 10:53:02 +01:00

23 lines
414 B
Python

from time import *
from gpiozero import *
from signal import pause
def led ():
print ('led allumé')
"""
print("One button to turn on or off")
led = LED(17)
btn = Button(20, bounce_time=None)
while True:
print('turn on')
led.on()
sleep(0.2) # to avoid bouncing
btn.wait_for_press()
print('turn off')
led.off()
sleep(0.2) # to avoid bouncing
btn.wait_for_press()
"""