02-13-2019, 02:36 AM
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.
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.