Salve, ho questo codice:
[php]#!/usr/bin/env python3
from gpiozero import LED,Button
from time import sleep
led = LED(17)
def main():
cmd = input("on, off , blink , button: ")
if cmd == 'on':
led.on()
main()
elif cmd == 'off':
led.off()
main()
elif cmd == 'blink':
try:
while True:
led.on()
sleep(1)
led.off()
sleep(1)
except KeyboardIn
|