Files
01-Resource/Pioneer600_code/LED/python/led.py
2023-03-05 23:38:38 +08:00

19 lines
284 B
Python

#!/usr/bin/python
# -*- coding:utf-8 -*-
import RPi.GPIO as GPIO
import time
LED = 26
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED,GPIO.OUT)
try:
while True:
GPIO.output(LED,GPIO.HIGH)
time.sleep(1)
GPIO.output(LED,GPIO.LOW)
time.sleep(1)
except:
print("except")
GPIO.cleanup()