Created
September 20, 2012 09:53
-
-
Save priyank/3754998 to your computer and use it in GitHub Desktop.
A sample Python program to test the GPIO library
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
from time import sleep | |
import RPi.GPIO as GPIO | |
# to use Raspberry Pi board pin numbers | |
GPIO.setmode(GPIO.BOARD) | |
# set up GPIO output channel | |
GPIO.setup(13, GPIO.OUT) | |
GPIO.setup(15, GPIO.OUT) | |
GPIO.setup(16, GPIO.OUT) | |
while 1: | |
GPIO.output(13, GPIO.LOW) | |
sleep(1) | |
GPIO.output(13, GPIO.HIGH) | |
sleep(1) | |
GPIO.output(15, GPIO.LOW) | |
sleep(1) | |
GPIO.output(15, GPIO.HIGH) | |
sleep(1) | |
GPIO.output(16, GPIO.LOW) | |
sleep(1) | |
GPIO.output(16, GPIO.HIGH) | |
sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment