Last active
August 29, 2015 14:00
-
-
Save schappim/11284296 to your computer and use it in GitHub Desktop.
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 sys | |
| pin = int(sys.argv[1].rstrip()) | |
| print pin | |
| import RPi.GPIO as GPIO ## Import GPIO library | |
| GPIO.setmode(GPIO.BOARD) ## Use board pin numbering | |
| GPIO.setup(pin, GPIO.OUT) ## Setup GPIO Pin to OUT | |
| state = False | |
| while 1: | |
| command = raw_input("wait for key") | |
| GPIO.output(pin,state) ## Turn on GPIO pin | |
| state = not state | |
| ## Red is 11 | |
| ## Green is 13 | |
| ## Blue is 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment