Skip to content

Instantly share code, notes, and snippets.

@Indavelopers
Last active June 6, 2017 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Indavelopers/2d2597d2d4e0a736ab1ae0d7a419bfe1 to your computer and use it in GitHub Desktop.
Save Indavelopers/2d2597d2d4e0a736ab1ae0d7a419bfe1 to your computer and use it in GitHub Desktop.
LED by pin up/down
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.OUT)
try:
while True:
GPIO.output(12, True)
time.sleep(0.5)
GPIO.output(12, False)
time.sleep(0.5)
except KeyboardInterrupt:
pass
finally:
print('Exiting')
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment