This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
Pi/led.py
2016-01-18 12:51:11 +01:00

22 lines
310 B
Python
Executable File

#!/usr/bin/python
from time import sleep
import RPi.GPIO as GPIO
pin = 14
try:
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.OUT)
while True:
GPIO.output(pin, 1)
sleep(1)
GPIO.output(pin, 0)
sleep(1)
except KeyboardInterrupt:
pass
finally:
GPIO.cleanup()