58 m_debounceTime = time;
84 units::second_t m_debounceTime;
86 DebounceType m_debounceType;
88 units::second_t m_prevTime;
92 bool HasElapsed()
const;
#define WPILIB_DLLEXPORT
Definition SymbolExports.h:36
A simple debounce filter for boolean streams.
Definition Debouncer.h:18
Debouncer(units::second_t debounceTime, DebounceType type=DebounceType::kRising)
Creates a new Debouncer.
constexpr DebounceType GetDebounceType() const
Get the debounce type.
Definition Debouncer.h:81
DebounceType
Type of debouncing to perform.
Definition Debouncer.h:23
@ kFalling
Falling edge.
Definition Debouncer.h:27
@ kRising
Rising edge.
Definition Debouncer.h:25
constexpr units::second_t GetDebounceTime() const
Gets the time to debounce.
Definition Debouncer.h:67
constexpr void SetDebounceType(DebounceType type)
Set the debounce type.
Definition Debouncer.h:74
constexpr void SetDebounceTime(units::second_t time)
Sets the time to debounce.
Definition Debouncer.h:57
bool Calculate(bool input)
Applies the debouncer to the input stream.
@ kBoth
Both rising and falling edges configuration.