Verifica inizializzazione GPIO su raspberry.

This commit is contained in:
Emiliano Vavassori 2024-09-04 17:11:19 +02:00
parent eb33823e80
commit d1d02e13b3

View File

@ -19,11 +19,14 @@ def accendi():
return "LED Spento."
@app.route('/spegni')
@app.route('/off')
def spegni():
led.pin_off()
if led.stato_pin():
return "LED acceso."
return "LED spento."
@app.route('/toggle')
def toggle():
@ -33,12 +36,12 @@ def toggle():
return "Il LED è spento."
@app.route('/lampeggia')
def lampeggia():
led.lampeggia()
return "LED ha lampeggiato."
if __name__ == '__main__':
led.setup()
app()
with app.app_context():
led.setup()
app.run()