Last active
June 6, 2017 15:09
-
-
Save Indavelopers/2d2597d2d4e0a736ab1ae0d7a419bfe1 to your computer and use it in GitHub Desktop.
LED by pin up/down
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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