This commit is contained in:
2026-03-24 23:06:07 +01:00
parent 5ae62fd6b0
commit 3ec7b207d9
16 changed files with 1128 additions and 86 deletions

22
flask/led.py Normal file
View File

@@ -0,0 +1,22 @@
from time import *
from gpiozero import *
from signal import pause
from log import log
def led(utilisateur):
print('led allumé')
log.info(f'led allumé par {utilisateur}')
"""
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()
"""