[RaspBerryPi]LED实验

2020/04 12 00:04
import RPi.GPIO as GPIO
import time
pin = 11
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.OUT)
for i in range(0, 5):
    GPIO.output(pin, True)
    time.sleep(1)
    GPIO.output(pin, False)
    time.sleep(1)
GPIO.cleanup()