#debounce #debouncer #button

no-std bounced

Debouncing and Testing for Signals and Buttons

3 unstable releases

0.2.0 Dec 27, 2020
0.1.1 Nov 13, 2020
0.1.0 Nov 1, 2020

#1116 in Embedded development

Apache-2.0

22KB
480 lines

Bounced

A utility to debounce signals.

Debouncing is best thought of as a running average. It might also be thought of as a hysteresis of an input: if the input changes, it needs to head towards the new state consistently and for long enough.

Contains an integration-type debouncer.

Compared to other debouncer libraries, it is extensible with your own debouncing algorithm.

TODO

  • const-generic-max type (built on top of shift-type)
  • random-noise type (for testing)

Other Uses

This library is probably generic enough so that if you have some input that upon meeting some desired history, the output could be some tri-state value (on, off, and None).

Other Projects

Projects similar to this include debouncr and debounced-pin.

Other inspirations include debounce.c.


lib.rs:

Debouncing Signals

Use the Debounced type for this crates functionality.

No runtime deps