Moode Forum
Momentary button function of rotary encoder - 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: Momentary button function of rotary encoder (/showthread.php?tid=1089)



Momentary button function of rotary encoder - ctek69 - 02-12-2019

Dear All

Long time and very happy user of Moode here, but first time using the forum.

Firstly, thanks to Tim and all who have contributed to this great software. I have been using IQ Audio boards and found Moode about two years ago when searching for a good case. I have a lovely setup in my office with a MoodeCase and IQAudIO AMP.

I would like install another system in the workshop. My plan is hide the electronics out of to way and just have a rotary encoder with integrated momentary switch and aluminium knob on display. I would like to be able to use the (single) momentary switch for two functions: short press "next track"; long press "toggle play/pause". I can see how to set one function, but I wonder if anyone could help me understand how to have a second function on the switch using a long press?

Many thanks in advance
Ant


RE: Momentary button function of rotary encoder - derekr - 02-13-2019

A crude way of doing it is to do your code equivalent of the following:

when button pressed (pin goes low or high)
delay 1 second (or whatever you deem suitable)
if, after delay period, button still held down (low or high) then that’s a long press
if not, it’s a short press

Only disadvantage is you always go through the delay period.


RE: Momentary button function of rotary encoder - ctek69 - 02-13-2019

(02-13-2019, 02:36 AM)derekr Wrote: A crude way of doing it is to do your code equivalent of the following:

when button pressed (pin goes low or high)
delay 1 second (or whatever you deem suitable)
if, after delay period, button still held down (low or high) then that’s a long press
if not, it’s a short press

Only disadvantage is you always go through the delay period.

Hi derekr

Thanks for your suggestion.

Perhaps I should have mentioned that I have no idea where to start with coding! Is there a useful guide that anyone could suggest I look at to start to learn this process?

I think your idea would be good, but the system is for various people to use who will not be as understanding as you or I might be, and a delay would lead to confusion and double presses.

Many thanks


RE: Momentary button function of rotary encoder - fedormil - 02-13-2019

last messages help you
http://moodeaudio.org/forum/showthread.php?tid=458&highlight=button