This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Detecting button sequences

Hi,

nRF51822. I'd like to detect single-click, double-click, triple-click, etc. button press sequences. Multiple clicks are when the next button press is within 1/2second of the previous one.

So, if the button is pressed and released and not pressed again within 1/2second, then I want to do something. But, if it's pressed again within 1/2second, I want to do something else. Etc.

The sequences get even more complicated later on with clicks followed by long presses, but I'd like to first get the multiple-click sequences figured out.

I have button detection working, but am stumped on the best algorithm to use for detecting the multiple clicks.

Thanks for the help.

Parents Reply Children
Related