Thank you for your donation!


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


Momentary button function of rotary encoder
#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


Messages In This Thread
RE: Momentary button function of rotary encoder - by derekr - 02-13-2019, 02:36 AM

Forum Jump: