76#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega2560__)
77#define DCSBIOS_IRQ_SERIAL
79#define DCSBIOS_DEFAULT_SERIAL
100#define AMPCD_ROT_OFF A1
105#define AMPCD_BACK_LIGHT 9
137DcsBios::Potentiometer ampcdBrtCtl(
"AMPCD_BRT_CTL",
AMPCD_ROT_A);
138DcsBios::Switch3Pos leftDdiCrsSw(
"LEFT_DDI_CRS_SW",
CRS_P,
CRS_M);
139DcsBios::Switch3Pos leftDdiHdgSw(
"LEFT_DDI_HDG_SW",
HDG_P,
HDG_M);
148DcsBios::IntegerBuffer instrIntLtBuffer(FA_18C_hornet_INSTR_INT_LT,
onInstrIntLtChange);
179 for (
int j = 0; j < 7; j++) {
210 for (
int j = 0; j < 7; j++) {
225 if (i == 0 or i == 1) {
226 if (j == 5) { DcsBios::sendDcsBiosMessage(
AMPCD_Btns[i],
"2"); }
227 if (j == 6) { DcsBios::sendDcsBiosMessage(
AMPCD_Btns[i],
"0"); }
229 if (j == 5) { DcsBios::sendDcsBiosMessage(
AMPCD_Btns[i],
"0"); }
230 if (j == 6) { DcsBios::sendDcsBiosMessage(
AMPCD_Btns[i],
"2"); }
233 DcsBios::sendDcsBiosMessage(
AMPCD_Btns[i],
"1");
236 int btnNum = 4 - j + 5 * i;
237 sprintf(btnName,
"AMPCD_PB_%02d", btnNum + 1);
238 DcsBios::sendDcsBiosMessage(btnName, btnState == 1 ?
"0" :
"1");
int index
Index to track the button press states.
#define AMPCD_IRQ
AMPCD IRQ Pin.
bool lastBtnState[28]
Array to hold the last state of the 20 AMPCD buttons, and 4 rocker switches.
unsigned long debounceDelay
The debounce delay duration in ms, increase if the output flickers.
bool buttonState[28]
Array to hold the current state of the 20 AMPCD buttons, and 4 rocker switches.
#define AMPCD_BACK_LIGHT
DDI Backlighting PWM, must be defined as digital pin #.
void onInstrIntLtChange(unsigned int newValue)
Setup DCS-BIOS control for DDI backlighting.
uint8_t inputRegister[4]
Input register for button read logic.
unsigned long lastDebounceTime[28]
Array to hold last time of AMPCD button update for debounce.
#define AMPCD_ROT_A
AMPCD Rotary Brightness.
char * AMPCD_Btns[]
DCS Bios Messages for the 4 AMPCD rocker switches.