Reliable detection of single, double and long clicks.
Can be used to debounce simple arduino digital pins, but also e.g. capacitive touch inputs.