Created
September 21, 2012 16:43
-
-
Save Yi-Tseng/3762556 to your computer and use it in GitHub Desktop.
using gpio to control raspberry PI I/O
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
from time import sleep | |
import RPi.GPIO as GPIO | |
GPIO.setwarnings(False) | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(13, GPIO.OUT) | |
GPIO.setup(15, GPIO.OUT) | |
GPIO.setup(16, GPIO.OUT) | |
GPIO.output(13,False) | |
GPIO.output(15,False) | |
GPIO.output(16,False) | |
while 1: | |
GPIO.output(13,True) | |
sleep(0.5) | |
GPIO.output(13,False) | |
GPIO.output(15,True) | |
sleep(0.5) | |
GPIO.output(15,False) | |
GPIO.output(16,True) | |
sleep(0.5) | |
GPIO.output(16,False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment