diff --git a/gpio.sh b/gpio.sh index b59577c..6bb50e3 100755 --- a/gpio.sh +++ b/gpio.sh @@ -1,9 +1,15 @@ #!/bin/bash -echo "Script: $0" +GPIO=$1 +value=$2 -echo "GPIO: $1" +PATH=/sys/class/gpio/chip0 + +echo "executing $0 script" +echo $GPIO > $PATH/export +echo out > $PATH/gpio$GPIO/direction +echo $value > $PATH/gpio$GPIO/value +echo $GPIO > $PATH/unexport -echo "Value: $2" echo "-_-_-_-_-_-"