-
-
Save dobrienSTJ/79464e3d38510cc127fcd70e0db2cdec to your computer and use it in GitHub Desktop.
STJLOL-DMU Basic GPIO
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
#the setup | |
import RPi.GPIO as GPIO #lets you use GPIO | |
from time import sleep #lets you use sleep(2) as a timer for the lights | |
GPIO.setmode(GPIO.BOARD) #tells the program what labeling system to use | |
GPIO.setup(17, GPIO.OUT) #tells the pi exactly what number pin you'll be using | |
#the code | |
GPIO.output(17, GPIO.HIGH) #tells the pi to turn on this pin | |
sleep(2) #waits 2 seconds | |
GPIO.output(17, GPIO.LOW) #tells the pi to turn off this pin | |
#the cleanup | |
GPIO.cleanup() #shuts down all GPIO stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment