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

24 lines
334 B
Python
Executable File

#!/usr/bin/python
from time import sleep
import RPi.GPIO as GPIO
print 'blah'
try:
GPIO.setmode(GPIO.BCM)
GPIO.setup(4, GPIO.OUT)
while True:
GPIO.output(4, 1)
sleep(1)
GPIO.output(4, 0)
sleep(1)
except KeyboardInterrupt:
GPIO.output(4, 0)
finally:
GPIO.cleanup()
print 'end'