Skip to content

Instantly share code, notes, and snippets.

@tomwhipple
Created December 2, 2012 01:09
Show Gist options
  • Save tomwhipple/4186303 to your computer and use it in GitHub Desktop.
Save tomwhipple/4186303 to your computer and use it in GitHub Desktop.
RaspberryPi GPIO demo
#!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