Thank you for your donation!


Instruction Guide Use hardware momentary switches to control moOde
#81
The help text under the SAVE button.

"NOTE: Use a comma to delimit arguments in the CMD field. Example: mpc,load,My Playlist"
Reply
#82
Hi Tim,

As I understand that GPIO3 wakes the Raspberry Pi from a halt state, if I configure a button with the 'sudo poweroff' command, and specify Pin 3, do you think that button will both power the Pi down and wake it up again without any additional coding?

Thanks,
Frank
Reply
#83
I haven't wired any buttons into a Pi but what I can say is that you don't need sudo for commands in the CMD field in GPIO Config. Just make sure that any commands with arguments for example "load playlist_name" are delimited with comma as below

load, playlist_name
Reply
#84
Hi Tim, hi everyone!

I followed all the steps in this thread and got te buttons finally working!

one more thing there is. Is it possible to assign multiple commands to one button in the GPIO Handler?
I'd need a "mpc,clear -> mpc,load,playlist -> mpc,play" all on one button press?

Thanks,
Alfred
Reply
#85
Opened the thread to ask exactly the same question Smile
Reply
#86
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
#87
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
#88
Yes, but use the absolute path instead of ~/

/home/pi/myscript.sh
Reply
#89
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: