Stuck on gpio pin clear-load-play-list - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: Stuck on gpio pin clear-load-play-list (/showthread.php?tid=3152) |
Stuck on gpio pin clear-load-play-list - avior - 11-12-2020 hi when i do this " mpc,load, Mp3 " it works and load the new play list but can,t get it play and clear the old list I tried this as well but don`t seem to work mpc,clear,load, Mp3 ,play mpc,clear, mpc,load,Mp3, play any ideas thanks RE: stuck on gpio pin - Tim Curtis - 11-12-2020 Put the commands in a script file /home/pi/myscript.sh mpc clear mpc load Mp3 mpc play Then specify the script file in the CMD field /home/pi/myscript.sh Remember to mark the script file as executable sudo chmod +x /home/pi/myscript.sh And put a shebang as the first line #!/bin/bash RE: stuck on gpio pin - avior - 11-12-2020 (11-12-2020, 02:35 PM)Tim Curtis Wrote: Put the commands in a script file /home/pi/myscript.sh Thank you for your reply Tim i am bit confused I have 2 play list one call "Radio" and the other call "MP3" I see you shown me how to do myscript but how would i go back to "Radio" playlist if i press the second button would i have to make another myscript to go back to Radio RE: Stuck on gpio pin clear-load-play-list - Tim Curtis - 11-12-2020 You could have the script accept an input argument. myscript.sh Mp3 myscript.sh Radio In the script $1 represents the first input argument. You would use the command below instead of mpc load Mp3 mpc load $1 Button 1 CMD field = /home/pi/myscript.sh,Mp3 Button 2 CMD field = /home/pi/myscript.sh,Radio RE: Stuck on gpio pin clear-load-play-list - avior - 11-12-2020 (11-12-2020, 04:56 PM)Tim Curtis Wrote: You could have the script accept an input argument. Brilliant Tim got it to work |