diff --git a/testprograms/gpioshell b/testprograms/gpioshell new file mode 100755 index 0000000..629c380 --- /dev/null +++ b/testprograms/gpioshell @@ -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()