Created
November 13, 2021 17:13
-
-
Save RealEmmettS/5e0644ec0960ca5b2138cec804e44ecc to your computer and use it in GitHub Desktop.
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.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