-
Notifications
You must be signed in to change notification settings - Fork 26
ActionButton
ActionButtonT
A single button (often momentary) where the falling edge of the button will send a specific message to DCS. This is a very flexible control that can be used creatively for more than just buttons. On the falling edge of an pin, any message with any value can be sent. Note that no message/argument is sent on the rising edge so this should not be used if the DCS control needs to be released (Use Switch2Pos for that).
ActionButton
ActionButton(const char* msg, const char* arg, char pin)
- msg - The message to send to DCS when the button is activated.
- arg - The argument (aka value) to send to DCS
- pin - The pin the button is connected to.
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::ActionButton canopyDisengageToggle("CANOPY_DISENGAGE", "TOGGLE", 1); // Pin 1 will toggle the state of the canopy actuator disengage lever each time the control has a rising edge
DcsBios::ActionButton iffDec("IFF_CODE", "INC", 1); DcsBios::ActionButton iffInc("IFF_CODE", "DEC", 27); // Hack 2 pins in a rotary control to increment/decrement IFF_CODE to work around a DCS bug.
typedef DcsBios::ActionButtonT<200> LowPriorityActionButton; // A custom switch that will use less cpu on each loop
ActionButton("AHCP_CICU", "1", 1); // Force CICU ON every time the button is activated