Rotary encoder for switching tracks - 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: Rotary encoder for switching tracks (/showthread.php?tid=6376) |
Rotary encoder for switching tracks - hcanning - 04-03-2024 Hi all, I want to use a rotary encoder (KY-040) for track skipping (previous/next track) rather than volume. I can see that there is native support for an encoder wired to certain GPIO pins on the Pi. Can anyone please point me in the direction of which files to edit/configure so that it performs the track skipping function rather than volume up/down? The KY-040 also has a push button function which I'd like to use for play/pause. I assume this acts as a normal button and I can map it using the GPIO button function in Moode directly? Thank you RE: Rotary encoder for switching tracks - hcanning - 04-07-2024 In case anyone else wants to do this, I initially started by trying to modify the Moode script that does the volume but I couldn't get it working satisfactorily. in the end I achieved this by writing a separate Python script which calls the mpc commands for prev/next, and setting it as a service, with an adequate sleep time so as not to absolutely nail the CPU. The debounce time and part of the script that ignores inputs if there are less than two consecutive clicks each direction help to make my cheap KY-040 encoder work smoothly. See below: Code: import RPi.GPIO as GPIO |