New Shell to controll GPIO PIN's

This commit is contained in:
LazyAssassin445
2017-03-14 21:31:19 +00:00
parent ed947850f9
commit 85b3fcffb1

22
testprograms/gpioshell Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/python3
import RPi.GPIO as GPIO
import time
import sys
def main():
gpio = int(input(""))
onoff = int(input(""))
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio, GPIO.OUT)
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio, GPIO.OUT)
GPIO.output(gpio, onoff)
main()
main()