Comment

Comment by the__alchemist

My thought is: This introduces latency that is not required (40ms could be a lot IMO depending on the use.) It's not required because you don't need latency on the first high/low signal; you only need to block subsequent ones in the bounce period; no reason to add latency to the initial push.

Also, (Again, depends on the use), there is a good chance you're handling button pushes using interrupts regardless of debouncing.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton