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'
|