Plaquette
 
Loading...
Searching...
No Matches
pq::Debounceable Class Referenceabstract

Superclass for components that can be debounced. More...

#include <PqInputs.h>

Inheritance diagram for pq::Debounceable:
Collaboration diagram for pq::Debounceable:

Public Member Functions

virtual void debounce (float debounceTime=PLAQUETTE_DEFAULT_DEBOUNCE_WINDOW)
 Apply smoothing to object.
 
virtual void noDebounce ()
 Remove smoothing.
 
virtual void smooth (float smoothTime=PLAQUETTE_DEFAULT_DEBOUNCE_WINDOW)
 Deprecated.
 
virtual void noSmooth ()
 Remove smoothing.
 
uint8_t debounceMode () const
 Returns the debounce mode.
 
void debounceMode (uint8_t mode)
 Sets debounce mode.
 
virtual void infiniteTimeWindow ()
 Sets time window to infinite.
 
virtual void noTimeWindow ()
 Sets time window to no time window.
 
virtual void timeWindow (float seconds)
 Changes the time window (expressed in seconds).
 
virtual float timeWindow () const
 Returns the time window (expressed in seconds).
 
virtual bool timeWindowIsInfinite () const
 Returns true if time window is infinite.
 
virtual void cutoff (float hz)
 Changes the time window cutoff frequency (expressed in Hz).
 
virtual float cutoff () const
 Returns the time window cutoff frequency (expressed in Hz).
 

Protected Member Functions

virtual bool _isOn ()=0
 
virtual float _time () const =0
 
virtual void _begin ()
 
virtual void _step ()
 
virtual bool _debounced ()
 
void _changeState ()
 
void _setStateFlag (const uint8_t flag)
 
void _unsetStateFlag (const uint8_t flag)
 
void _toggleStateFlag (const uint8_t flag)
 
bool _getStateFlag (const uint8_t flag)
 

Protected Attributes

float _startTime
 
uint8_t _state
 
uint8_t _debounceMode
 
float _timeWindow
 

Detailed Description

Superclass for components that can be debounced.

Member Function Documentation

◆ debounceMode()

void pq::Debounceable::debounceMode ( uint8_t  mode)
inline

Sets debounce mode.

Parameters
modethe debounce mode (DEBOUNCE_DEFAULT, DEBOUNCE_LOCK_OUT or DEBOUNCE_PROMPT_DETECT)

◆ noSmooth()

virtual void pq::Debounceable::noSmooth ( )
inlinevirtual

Remove smoothing.

Deprecated:

◆ smooth()

virtual void pq::Debounceable::smooth ( float  smoothTime = PLAQUETTE_DEFAULT_DEBOUNCE_WINDOW)
inlinevirtual

Deprecated.

Left for backwards compatibility.

Deprecated:

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