Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Momentary button function of rotary encoder
#1
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
Reply
#2
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.
Reply
#3
(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
Reply
#4
last messages help you
http://moodeaudio.org/forum/showthread.p...ght=button
Reply


Forum Jump: