Project trouble with interface.sh using buttons
Posted: Thu Apr 07, 2011 5:24 am
Hi all,
I am doing my final year project base on Mightyohms router.
I am stuck on the interface.sh bash script,
1st on the hardware my display is displaying fine and my tuner buttons are workin but when i try to add a volume button the interface file does not know what to do it, it can not read it.
Please help
Loi
here is my interface code.
while true # loop forever
do
inputline="" # clear input
# Loop until we get a valid tuner position from the AVR
until inputline=$(echo $inputline | grep -e "^tuner: ") || $(echo $inputline | grep -e "^tuner: ")
do
inputline=$(head -n 1 < /dev/tts/0)
done
value=$(echo $inputline | sed 's/tuner: ) # strip out the tuner: part
#echo "$value"
if [ "$VOLUME" -ne "$oldvol" ]
then
mpc volume $VOLUME
fi
oldvol=$VOLUME
station=$value
# if station has changed, we need to change position in the playlist
if [ "$station" -ne "$oldstation" ]
then
echo "Tuner Position: " $value
echo "New station..."
mpc play $station
fi
oldstation=$station # remember what station we're on so we know
# if we need to change stations next time around
done
}
I am doing my final year project base on Mightyohms router.
I am stuck on the interface.sh bash script,
1st on the hardware my display is displaying fine and my tuner buttons are workin but when i try to add a volume button the interface file does not know what to do it, it can not read it.
Please help
Loi
here is my interface code.
while true # loop forever
do
inputline="" # clear input
# Loop until we get a valid tuner position from the AVR
until inputline=$(echo $inputline | grep -e "^tuner: ") || $(echo $inputline | grep -e "^tuner: ")
do
inputline=$(head -n 1 < /dev/tts/0)
done
value=$(echo $inputline | sed 's/tuner: ) # strip out the tuner: part
#echo "$value"
if [ "$VOLUME" -ne "$oldvol" ]
then
mpc volume $VOLUME
fi
oldvol=$VOLUME
station=$value
# if station has changed, we need to change position in the playlist
if [ "$station" -ne "$oldstation" ]
then
echo "Tuner Position: " $value
echo "New station..."
mpc play $station
fi
oldstation=$station # remember what station we're on so we know
# if we need to change stations next time around
done
}