Skip to content

Instantly share code, notes, and snippets.

@jsherer

jsherer/ptt.sh

Created Apr 10, 2019
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@jsherer 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