01-12-2021, 08:22 AM
Opened the thread to ask exactly the same question
Thank you for your donation!
Instruction Guide Use hardware momentary switches to control moOde
|
01-12-2021, 08:22 AM
Opened the thread to ask exactly the same question
01-12-2021, 02:03 PM
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
01-13-2021, 09:27 AM
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?
01-13-2021, 12:41 PM
Yes, but use the absolute path instead of ~/
/home/pi/myscript.sh
04-14-2021, 07:45 PM
(This post was last modified: 04-14-2021, 08:04 PM by vandalsavage.)
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.
Sorry for the noob question, but I'm hapless with code. I'm trying to make a super-simple radio for my mother-in-law that has two dials -- volume, and track change (I'd rather it be playlist change, but I'll take what I can get). I have the rotary encoders wired up, and I borrowed Cyanoazemins' script and edited it, which is I'm sure where my problems start. Instead of having one rotary encoder that does volume, one that changes track, and the pushbutton switch toggling pause/play on both, I have one rotary encoder that mutes the audio if I push the button.
Here's the code I came up with: Code: #!/usr/bin/python I followed the directions in the first post on this thread for creating the buttons.py file and pointing rc.local to it, but...nope. No controls other than mute as long as I'm holding down the tuner dial's button. Thanks for the help! (I don't know what 'reliably enough' might mean in that comment line which I didn't notice before now, so if that's my problem -- I guess I just need to lose the volume. Which is acceptable) EDIT: So I got it. I commented out every line that didn't directly impact my situation, then I went to the config and told the GPIO configurator what the pins were supposed to do, said a short prayer to Baphomet, rebooted, and shazam.
08-27-2021, 02:21 PM
Not sure if this is the thread, but it hopefully is.
How well will a rotary connector work here when there's a rotary connector in use for the volume control? |
« Next Oldest | Next Newest »
|