Last active
January 2, 2017 23:19
Star
You must be signed in to star a gist
Raspberry Pi header pins python example. Pinout: https://www.megaleecher.net/sites/default/files/images/raspberry-pi-rev2-gpio-pinout.jpg
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 | |
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