Created
April 10, 2019 13:50
-
-
Save jsherer/dd09895ab23bdf571e2117cdd814c198 to your computer and use it in GitHub Desktop.
GPIO Toggle Script for JS8Call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
STATE=$1 | |
PIN=12 | |
if [ $# -le 0 ]; then | |
echo -e "\nUsage:\n$0 state \n" | |
exit 1 | |
fi | |
if [ "$STATE" = "on" ]; then | |
echo "toggling gpio $PIN on"; | |
gpio write $PIN 1 | |
else | |
echo "toggling gpio $PIN off"; | |
gpio write $PIN 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use:
PIN
variable if you need it to be a different GPIO pin than number12
chmod +x /path/to/ptt.sh
/path/to/ptt.sh on
and/path/to/ptt.sh off
/path/to/ptt.sh %1