API Documentation v0.0.1
|
Provides debounce logic for multiposition switches used in DCS to prevent erroneous readings during switch transitions. More...
#include <5A7A1-SNSR_PANEL.h>
Public Member Functions | |
SwitchMultiPosDebounce (const char *msg, const byte *pins, char numberOfPins, bool reverse=false, unsigned long debounceDelay=50) | |
void | SetControl (const char *msg) |
void | resetThisState () |
void | pollThisInput () |
Provides debounce logic for multiposition switches used in DCS to prevent erroneous readings during switch transitions.
This class extends the functionality of the DCS BIOS library's SwitchMultiPos method by adding debounce logic. This ensures that while a knob is rotating, its output doesn't mistakenly bounce to an unconnected or default position between detents.
Definition at line 56 of file 5A7A1-SNSR_PANEL.h.
|
inline |
Constructor for initializing a debounced multiposition switch.
msg | The DCS BIOS message identifier associated with this switch. |
pins | Array of physical pin numbers connected to the switch positions. |
numberOfPins | Number of positions (pins) on the switch. |
reverse | Set to true to reverse the reading logic (for normally high switches). |
debounceDelay | Debounce time in milliseconds. |
Definition at line 120 of file 5A7A1-SNSR_PANEL.h.
References debounceDelay, and pins.
|
inline |
Sets or changes the DCS BIOS message for the switch control.
msg | New DCS BIOS message identifier for the switch. |
Definition at line 139 of file 5A7A1-SNSR_PANEL.h.
|
inline |
Public interface to reset the state of the switch.
Definition at line 146 of file 5A7A1-SNSR_PANEL.h.
|
inline |
Public interface to check the input state of the switch and apply debounce logic.
Definition at line 153 of file 5A7A1-SNSR_PANEL.h.
Referenced by loop().