Created
October 23, 2012 22:07
-
-
Save sirkosi/3941964 to your computer and use it in GitHub Desktop.
raspberry pi example
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 sys | |
from time import sleep | |
# to use Raspberry Pi board pin numbers | |
GPIO.setmode(GPIO.BOARD) | |
# set up GPIO output channel | |
GPIO.setup(8, GPIO.OUT) | |
while 1: | |
keyin = sys.stdin.read(1) | |
if keyin is not False: | |
GPIO.output(8, GPIO.HIGH) | |
sleep(0.1) | |
GPIO.output(8, GPIO.LOW) | |
keyin = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment