Action Button - Gadroc/dcs-bios-arduino GitHub Wiki
ActionButton monitors a digital input and sends a command with argument to DCS.
Direct Input Constructor
ActionButton(const char* message, const char* arg, uint8_t pin, int debounceTime)
Parameters | Type | Description |
---|---|---|
message | string | Message to be sent to DCS BIOS. |
arg | string | Argument to be sent with the message. |
pin | uint8_t | Pin number to look for input. |
debounceTime | int | (Optional)Amount of time in milliseconds to wait for debounce of switches, if not supplied defaults to 10ms. |
Example
ActionButton antiSkidSwitchPush("ANTI_SKID_SWITCH", "PUSH", 5);
This will watch Digital Pin 5 and when it goes low (connected to ground). "ANTI_SKID_SWITCH PUSH" will be sent to DCS-BIOS.
IO Expander Constructor
ActionButton(const char* message, const char* arg, InputPin* pin)
Parameters | Type | Description |
---|---|---|
message | string | Message to be sent to DCS BIOS. |
arg | string | Argument to be sent with the message. |
pin | InputPin pointer | Pointer to input pin from IO Expander. |
Example
Mcp23017 inputPins(B0100001);
ActionButton antiSkidSwitchPush("ANTI_SKID_SWITCH", "PUSH", inputPins.getPin(3));
This will watch pin 3 on an MCP23017 IO Expander and when it goes low (connected to ground). "ANTI_SKID_SWITCH PUSH" will be sent to DCS-BIOS.