Thank you for your donation!


Instruction Guide Use hardware momentary switches to control moOde
#81
Opened the thread to ask exactly the same question Smile
Reply
#82
Just put the commands in a BASH script and assign the script to the button

1. Create myscript.sh in your home directory /home/pi/ otherwise referred to as ~
See example below.

#!/bin/bash
mpc clear
mpc load "my_playlist"
mpc play

2. Mark it executable

chmod +x ~/myscript.sh
Reply
#83
Thanks Tim. When you say assign the script to that button you mean put "~/my script.sh" into the GPIO dialog box in Moode instead of "mpc play" etc?
Reply
#84
Yes, but use the absolute path instead of ~/

/home/pi/myscript.sh
Reply
#85
Hi every 1.First of all i will like to thank Tim for all his work end effort invested in this great project.i realy love it.now to my problem/request.for my moode project i would to add only one button(pull-down) for both power up and power down.my problem is although i possess a fair amount of  knowledge about electronics my coding knowledge is close to zero and from my researches for this project  some coding is necessary(i might be wrong).so if anyone has some ideas i will be very happy to put them in practice.thank you.i forgot to mention that i'm useing a rasberry pi 3+ 1Gb board plus IQaudIO Pi-DigiAMP+ with a 5 inch touchscreen display.
Reply


Forum Jump: