개발이야기
Blink LED - python raspberry pi 3
AndersonChoi
2022. 9. 12. 11:34
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17, GPIO.OUT, initial=GPIO.LOW)
while True:
GPIO.output(17, GPIO.HIGH)
print("LED on")
sleep(1)
GPIO.output(17, GPIO.LOW)
print("LED off")
sleep(1)
반응형