Last active
February 7, 2017 10:20
-
-
Save 15nmcgoldrick/986fdee5510a6d53f9e74588f724be96 to your computer and use it in GitHub Desktop.
rover code fam
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 | |
from time import sleep | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(23,GPIO.out) | |
GPIO.setup(17,GPIO.out) | |
GPIO.setup(16,GPIO.out) | |
#the code | |
GPIO.output(16,GPIO.HIGH) #turns green light on | |
GPIO.output(23, GPIO.HIGH) #turns motor on | |
sleep(5) #this allows the previous action to work for 5 seconds | |
GPIO.output(23,GPIO.LOW) #turns motor off | |
GPIO.output(16,GPIO.LOW) #turns green light off | |
GPIO.output(23,GPIO.HIGH) | |
GPIO.output(17,GPIO.HIGH) | |
sleep(5) | |
GPIO.output(23,GPIO.LOW) | |
GPIO.output(17,GPIO.LOW) | |
cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment