Skip to content

Instantly share code, notes, and snippets.

@Indavelopers Indavelopers/rpi_led.py

Last active Jun 6, 2017
Embed
What would you like to do?
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
You can’t perform that action at this time.