-
Notifications
You must be signed in to change notification settings - Fork 23
Switch2Pos
Talbot edited this page Nov 30, 2021
·
3 revisions
Switch2PosT
Common 2 position (ON-OFF) switch.
Switch2Pos
Switch2PosT(const char* msg, char pin, bool reverse = false, unsigned long debounceDelay = 50)
- msg - The message to send to DCS when the switch is activated or deactivated.
- reverse - Invert the polarity of the physical switch.
- debounceDelay - Time in milliseconds that the switch is allowed to stop bouncing before being sent. Shorter = more responsive, longer = more bounce tolerance.
template <unsigned long pollIntervalMs = POLL_EVERY_TIME>
- pollIntervalMs - Time in milliseconds between times this control should be sampled. Increase for less time sensitive controls to lower the CPU load required for this control.
DcsBios::Switch2Pos switch2PosExample("AHCP_JTRS", 1); // A standard 2 position on/off switch
DcsBios::Switch2Pos switch2PosExample("AHCP_TGP", 1, TRUE); // Inverted standard switch
typedef DcsBios::Switch2PosT<200> LowPrioritySwitch2Pos; // A custom switch that will use less cpu on each loop
LowPrioritySwitch2Pos("AHCP_CICU", 1);