Skip to content

Instantly share code, notes, and snippets.

@jsherer
Created April 10, 2019 13:50
Show Gist options
  • Save jsherer/dd09895ab23bdf571e2117cdd814c198 to your computer and use it in GitHub Desktop.
Save jsherer/dd09895ab23bdf571e2117cdd814c198 to your computer and use it in GitHub Desktop.
GPIO Toggle Script for JS8Call
#!/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
@jsherer
Copy link
Author

jsherer commented Apr 10, 2019

How to use:

  1. Copy this script to a location on your machine
  2. Edit the PIN variable if you need it to be a different GPIO pin than number 12
  3. Make the script executable: chmod +x /path/to/ptt.sh
  4. Test that it works: /path/to/ptt.sh on and /path/to/ptt.sh off
  5. Configure JS8Call to use it as a PTT Command: /path/to/ptt.sh %1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment