Last active
January 2, 2017 23:19
-
-
Save L1fescape/0b6627f00553575749672f7d6fd66c6b to your computer and use it in GitHub Desktop.
Raspberry Pi header pins python example. Pinout: https://www.megaleecher.net/sites/default/files/images/raspberry-pi-rev2-gpio-pinout.jpg
This file contains hidden or 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