Skip to content

Instantly share code, notes, and snippets.

@salexkidd
Last active August 29, 2015 14:13
Show Gist options
  • Save salexkidd/6bb0fc12b3cdfebe858b to your computer and use it in GitHub Desktop.
Save salexkidd/6bb0fc12b3cdfebe858b to your computer and use it in GitHub Desktop.
Led on off
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
import random
IO_PIN = 15
GPIO.setmode(GPIO.BCM)
GPIO.setup(IO_PIN, GPIO.OUT)
try:
while True:
time.sleep(1000)
GPIO.output(IO_PIN, True)
time.sleep(1000)
GPIO.output(IO_PIN, False)
except KeyboardInterrupt:
print "clean up"
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment