Arduino double click button

Hey there,
I want to add a double click function in my code. But how can I do this?
And is ther a possiblity to distinguish between a normal click and a double click?

I'm looking forward to your replies.

Best regards

Maurice W.

The way to differentiate is based on time. When you get a click, use millis to get the time and compare to the time at the last click. If they are sufficiently close together then it's a double click.

I have a small library to handle switch presses. It can detect press, long press and double press, with auto repeat if held down. If you are interested in using it or seeing how it is done, link is below (code repository). How the detection works is also described on my blog.