Skip to content

Instantly share code, notes, and snippets.

@RealEmmettS
Created November 13, 2021 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RealEmmettS/5e0644ec0960ca5b2138cec804e44ecc to your computer and use it in GitHub Desktop.
Save RealEmmettS/5e0644ec0960ca5b2138cec804e44ecc to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
from time import sleep
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW)
run = 1
while run == 1:
mode = input("On, Off, or Exit?: ")
if mode == "On":
GPIO.output(8, GPIO.HIGH)
elif mode == "Off":
GPIO.output(8, GPIO.LOW)
elif mode == "Exit":
run = 0
else:
print("Please type On, Off, or Exit")
print("Goodbye!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment