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

26 lines
352 B
Python
Raw Normal View History

2015-12-23 20:09:52 +00:00
#!/usr/bin/python
from time import sleep
import RPi.GPIO as GPIO
print 'blah'
2015-12-31 13:11:37 +00:00
pin = 14
2015-12-23 20:09:52 +00:00
try:
GPIO.setmode(GPIO.BCM)
2015-12-31 13:11:37 +00:00
GPIO.setup(pin, GPIO.OUT)
2015-12-23 20:09:52 +00:00
while True:
2015-12-31 13:11:37 +00:00
GPIO.output(pin, 1)
2015-12-23 20:09:52 +00:00
sleep(1)
2015-12-31 13:11:37 +00:00
GPIO.output(pin, 0)
2015-12-23 20:09:52 +00:00
sleep(1)
except KeyboardInterrupt:
2015-12-31 13:11:37 +00:00
GPIO.output(pin, 0)
2015-12-23 20:09:52 +00:00
finally:
GPIO.cleanup()
print 'end'