Skip to content

Instantly share code, notes, and snippets.

@L1fescape
Last active January 2, 2017 23:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save L1fescape/0b6627f00553575749672f7d6fd66c6b to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
import time
ledPin = 18
GPIO.setmode(GPIO.BCM)
GPIO.setup(ledPin, GPIO.OUT)
GPIO.output(ledPin, GPIO.LOW)
try:
while True:
GPIO.output(ledPin, GPIO.HIGH)
time.sleep(1)
GPIO.output(ledPin, GPIO.LOW)
time.sleep(1)
except KeyboardInterrupt: # If CTRL+C is pressed, exit cleanly:
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment