1.0
This commit is contained in:
22
flask/bouton.py
Normal file
22
flask/bouton.py
Normal file
@@ -0,0 +1,22 @@
|
||||
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()
|
||||
"""
|
||||
Reference in New Issue
Block a user