04-10-2022, 08:12 AM
(09-28-2021, 07:56 PM)Tim Curtis Wrote:Code:#!/bin/bash
# Initialize GPIOs
if [[ $1 = "init" ]]; then
/usr/local/bin/gpio -g mode 23 out
/usr/local/bin/gpio -g mode 24 out
exit
fi
# Switch On/Off
if [[ $1 = "switch" ]]; then
# Amp 1
if [ $2 = "On" ]; then
/usr/local/bin/gpio -g write 23 1
fi
if [ $2 = "Off" ]; then
/usr/local/bin/gpio -g write 23 0
fi
# Amp 2
if [ $3 = "On" ]; then
/usr/local/bin/gpio -g write 24 1
fi
if [ $3 = "Off" ]; then
/usr/local/bin/gpio -g write 24 0
fi
exit
fi
Example script
I think it would be nice to add an on/off switch to the main menu (e.g. above the "Power" option), and once moOde done booting up, use this switch to turn the amp on or off as you like.