2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
DebouncedDigitalInput Class Reference

#include <DebouncedDigitalInput.h>

Public Member Functions

 DebouncedDigitalInput ()=delete
 
 DebouncedDigitalInput (uint8_t pinNumber, bool usePullup=false)
 
 DebouncedDigitalInput (uint8_t pinNumber, uint8_t groundPin, bool usePullup=false)
 
 DebouncedDigitalInput (uint8_t pinNumber, uint8_t groundPin, uint16_t debounceSamples, bool usePullup=false)
 
DebouncedDigitalInputoperator= (const DebouncedDigitalInput &)=delete
 
void Initialize ()
 
bool Update ()
 
bool GetValue () const
 
bool GetRawValue () const
 
void Reset (bool newValue=false)
 
void SetDebounceCount (uint16_t newCount)
 

Private Attributes

const uint8_t m_readPin
 Arduino pin number for this input.
 
const uint8_t m_groundPin
 Arduino pin number used as a ground source.
 
const bool m_usePullup
 True uses Arduino internal pullup resistor.
 
uint16_t m_debounceSamples
 Number of samples new value must be held before debounced value changes.
 
bool m_initialized
 True once initialization has completed.
 
uint16_t m_debounceCount
 Number of samples that do not match the current debounced value.
 
bool m_rawValue
 Latest read value without debouncing.
 
bool m_debouncedValue
 Active debounced value.
 

Constructor & Destructor Documentation

◆ DebouncedDigitalInput() [1/4]

DebouncedDigitalInput::DebouncedDigitalInput ( )
delete

◆ DebouncedDigitalInput() [2/4]

DebouncedDigitalInput::DebouncedDigitalInput ( uint8_t  pinNumber,
bool  usePullup = false 
)
explicit

◆ DebouncedDigitalInput() [3/4]

DebouncedDigitalInput::DebouncedDigitalInput ( uint8_t  pinNumber,
uint8_t  groundPin,
bool  usePullup = false 
)

◆ DebouncedDigitalInput() [4/4]

DebouncedDigitalInput::DebouncedDigitalInput ( uint8_t  pinNumber,
uint8_t  groundPin,
uint16_t  debounceSamples,
bool  usePullup = false 
)

Member Function Documentation

◆ GetRawValue()

bool DebouncedDigitalInput::GetRawValue ( ) const

◆ GetValue()

bool DebouncedDigitalInput::GetValue ( ) const

◆ Initialize()

void DebouncedDigitalInput::Initialize ( )

◆ operator=()

DebouncedDigitalInput & DebouncedDigitalInput::operator= ( const DebouncedDigitalInput )
delete

◆ Reset()

void DebouncedDigitalInput::Reset ( bool  newValue = false)

◆ SetDebounceCount()

void DebouncedDigitalInput::SetDebounceCount ( uint16_t  newCount)

◆ Update()

bool DebouncedDigitalInput::Update ( )

Member Data Documentation

◆ m_debounceCount

uint16_t DebouncedDigitalInput::m_debounceCount
private

Number of samples that do not match the current debounced value.

◆ m_debouncedValue

bool DebouncedDigitalInput::m_debouncedValue
private

Active debounced value.

◆ m_debounceSamples

uint16_t DebouncedDigitalInput::m_debounceSamples
private

Number of samples new value must be held before debounced value changes.

◆ m_groundPin

const uint8_t DebouncedDigitalInput::m_groundPin
private

Arduino pin number used as a ground source.

◆ m_initialized

bool DebouncedDigitalInput::m_initialized
private

True once initialization has completed.

◆ m_rawValue

bool DebouncedDigitalInput::m_rawValue
private

Latest read value without debouncing.

◆ m_readPin

const uint8_t DebouncedDigitalInput::m_readPin
private

Arduino pin number for this input.

◆ m_usePullup

const bool DebouncedDigitalInput::m_usePullup
private

True uses Arduino internal pullup resistor.


The documentation for this class was generated from the following files: