#!/bin/bash # just pass the GPIO number in from pine64_pins.html # switches the specified GPIO to high for 1 second # then back to low and removes it from the list of # system controlled GPIO pins # # example, test pin 16, which is labled as Pi GPIO 23 # ./test.sh 77 gpio=$1 echo $gpio > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio$gpio/direction echo "1" > /sys/class/gpio/gpio$gpio/value sleep 1 echo "0" > /sys/class/gpio/gpio$gpio/value sleep .1 echo $gpio > /sys/class/gpio/unexport