Updated gpioshell
This commit is contained in:
@@ -4,19 +4,28 @@ import RPi.GPIO as GPIO
|
||||
import time
|
||||
import sys
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.cleanup()
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
|
||||
def main():
|
||||
gpio = int(input(""))
|
||||
onoff = int(input(""))
|
||||
gpio = int(input(""))
|
||||
onoff = int(input(""))
|
||||
|
||||
GPIO.setwarnings(False)
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(gpio, GPIO.OUT)
|
||||
GPIO.cleanup()
|
||||
GPIO.setup(gpio, GPIO.OUT)
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(gpio, GPIO.OUT)
|
||||
GPIO.output(gpio, onoff)
|
||||
|
||||
GPIO.output(gpio, onoff)
|
||||
main()
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(gpio, GPIO.OUT)
|
||||
GPIO.cleanup()
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(gpio, GPIO.OUT)
|
||||
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user