From 85b3fcffb14669ac72346ebd6a7d06d9e373b42b Mon Sep 17 00:00:00 2001 From: LazyAssassin445 Date: Tue, 14 Mar 2017 21:31:19 +0000 Subject: [PATCH] New Shell to controll GPIO PIN's --- testprograms/gpioshell | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 testprograms/gpioshell 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()