Created
November 10, 2017 14:40
-
-
Save wzr1337/d877bf98560b2f389b3d22f3f7121eb3 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 RPi.GPIO as GPIO | |
import time | |
print GPIO.VERSION | |
#set up GPIO using BOARD numbering | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(12, GPIO.OUT) | |
GPIO.setup(16, GPIO.OUT) | |
GPIO.setup(18, GPIO.OUT) | |
try: | |
while True: | |
# light 12 | |
GPIO.output(12, GPIO.HIGH) | |
time.sleep(0.2) | |
# off 12 | |
GPIO.output(12, GPIO.LOW) | |
# light 16 | |
GPIO.output(16, GPIO.HIGH) | |
time.sleep(0.2) | |
# off 16 | |
GPIO.output(16, GPIO.LOW) | |
# light 18 | |
GPIO.output(18, GPIO.HIGH) | |
time.sleep(0.2) | |
# off 18 | |
GPIO.output(18, GPIO.LOW) | |
except KeyboardInterrupt: | |
pass | |
# cleanup | |
GPIO.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment