-
Notifications
You must be signed in to change notification settings - Fork 23
Switch3Pos
Talbot edited this page Nov 18, 2021
·
1 revision
Switch3PosT
Common 3 position (ON-OFF-ON) switch.
Switch3Pos
Switch3PosT(const char* msg, char pinA, char pinB, unsigned long debounceDelay = 50)
- msg - The message to send to DCS when the switch is activated or deactivated.
- pinA - The pin that the normally "UP/RIGHT" side of the switch is connected to.
- pinB - The pin that the normally "DOWN/LEFT" side of the switch is connected to.
- 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::Switch3Pos lasteApMode("LASTE_AP_MODE", 1, 2); // A standard 3 position on/off switch connected to pins 1 and 2
typedef DcsBios::Switch3PosT<200> LowPrioritySwitch3Pos; // A custom switch that will use less cpu on each loop
LowPrioritySwitch3Pos("CDU_DATA", 1, 2);