7#include "wpi/units/time.hpp"
38 explicit Debouncer(wpi::units::second_t debounceTime,
56 m_debounceTime = time;
66 return m_debounceTime;
75 m_debounceType = type;
88 wpi::units::second_t m_debounceTime;
90 DebounceType m_debounceType;
92 wpi::units::second_t m_prevTime;
96 bool HasElapsed()
const;
#define WPILIB_DLLEXPORT
Definition SymbolExports.hpp:36
DebounceType
Type of debouncing to perform.
Definition Debouncer.hpp:21
@ kBoth
Both rising and falling edges.
Definition Debouncer.hpp:27
@ kRising
Rising edge.
Definition Debouncer.hpp:23
@ kFalling
Falling edge.
Definition Debouncer.hpp:25
bool Calculate(bool input)
Applies the debouncer to the input stream.
constexpr void SetDebounceTime(wpi::units::second_t time)
Sets the time to debounce.
Definition Debouncer.hpp:55
constexpr wpi::units::second_t GetDebounceTime() const
Gets the time to debounce.
Definition Debouncer.hpp:65
Debouncer(wpi::units::second_t debounceTime, DebounceType type=DebounceType::kRising)
Creates a new Debouncer.
constexpr DebounceType GetDebounceType() const
Get the debounce type.
Definition Debouncer.hpp:85
constexpr void SetDebounceType(DebounceType type)
Set the debounce type.
Definition Debouncer.hpp:74
Definition LinearSystem.hpp:20