Created
December 2, 2012 01:09
-
-
Save tomwhipple/4186303 to your computer and use it in GitHub Desktop.
RaspberryPi GPIO demo
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
#!python | |
# | |
# "Hello World!" for RaspberryPi GPIO. Assumes you've correctly connected an LED to pin 5. | |
# | |
import RPi.GPIO as gpio | |
import time | |
LED_PIN = 5 | |
gpio.setmode(gpio.BOARD) | |
gpio.setup(LED_PIN, gpio.OUT) | |
lit = True | |
while True: | |
gpio.output(LED_PIN, lit) | |
lit = not lit | |
time.sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment