Questo codice non accende e spegne il led.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(21,GPIO.OUT)
for number in range(0,10):
GPIO.output(21,GPIO.LOW)
time.sleep(1)
GPIO.output(21,GPIO.HIGH)
GPIO.cleanup()
ma quando stampo il numero nel ciclo funziona:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(21,GPIO.OUT)
for number in range(0,10):
GPIO.output(21,GPIO.LOW)
time.sleep(1)
GPIO.output(21,GPIO.HIGH)
print(number)
GPIO.cleanup()
Qualche idea sul perché?