Debounce

Applies to: c, embedded

Debounce filters rapid mechanical switch changes so one button press is counted once.

if (stable_for_ms(20)) pressed = read_button();

See also: gpio, boolean