WPILibC++ 2023.4.3-108-ge5452e3
|
A simple debounce filter for boolean streams. More...
#include <frc/filter/Debouncer.h>
Public Types | |
enum | DebounceType { kRising , kFalling , kBoth } |
Public Member Functions | |
Debouncer (units::second_t debounceTime, DebounceType type=DebounceType::kRising) | |
Creates a new Debouncer. More... | |
bool | Calculate (bool input) |
Applies the debouncer to the input stream. More... | |
A simple debounce filter for boolean streams.
Requires that the boolean change value from baseline for a specified period of time before the filtered value changes.
|
explicit |
Creates a new Debouncer.
debounceTime | The number of seconds the value must change from baseline for the filtered value to change. |
type | Which type of state change the debouncing will be performed on. |
bool frc::Debouncer::Calculate | ( | bool | input | ) |
Applies the debouncer to the input stream.
input | The current value of the input stream. |