Skip to content

Instantly share code, notes, and snippets.

@michaeltennant4554
Last active January 19, 2017 15:14
Show Gist options
  • Save michaeltennant4554/3a5b8d8c0b7c18d667a35f9d80faf896 to your computer and use it in GitHub Desktop.
Save michaeltennant4554/3a5b8d8c0b7c18d667a35f9d80faf896 to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO #this puts the GPIO in the program always has to be first.
sleep (5) #this stops the pi from doing something straight away and makes it wait.
GPIO.setmode(GPIO.BCM) #sets the mide of the pi to Bcm this is always the second.
GPIO.setup(17,GPIO.OUT) #TELLS THE pi that u what number on the GPIO you will be useing.
GPIO.setup(23,GPIO.OUT
GPIO.setup(24,GPIO.OUT)
GPIO.setup(27,GPIO.OUT)
GPIO.output(23,GPIO.HIGH #turns the pi on
GPIO.output(24,GPIO.HIGH
GPIO.output(27,GPIO.HIGH
GPIO.output(17,GPIO.HIGH
GPIO.output(23,GPIO.LOW) #turns it off
GPIO.output(24,GPIO.LOW)
GPIO.output(27,GPIO.LOW)
GPIO.output(17,GPIO.LOW)
def motars():
print("THIS SHOULD WORK")
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment