Jump to content

RassieRaider

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by RassieRaider

  1. G'day blokes and blokettes, Is anyone able to explain why this code below would not communicate with DCS at all? I am using a MEGA2560 board. My matrix is wired like the screenshot attached, the only difference being which pins the rows and columns are connected to (they are wired as per the code below). I tried wiring buttons individually to pins through a diode (1N4001) with the cathode pointing to the rows, and that didn't work either when I used the generic Control Reference codes in the #define DCSBIOS_DEFAULT_SERIAL. Both methods don't work with IRQ_SERIAL either. When I say it doesn't work, I mean I get zero response, not even ghosting etc. DCS BIOS is configured correctly, I get virtual cockpit connection and COMM connection through the correct port etc. and the code verifies and successfully uploads to the board. This is for an F18 UFC using the control reference for the 'CASE' SendDcsBiosMessage lines. Cheers in advance. #define DCSBIOS_DEFAULT_SERIAL #include <Keypad.h> #include <DcsBios.h> const byte ROWS = 4; //four rows const byte COLS = 4; //four columns char keys[ROWS][COLS] = { {'1','2','3','B'}, {'4','5','6','C'}, {'7','8','9','D'}, {'*','0','#','E'} //ufc keypad minus the top right option select (A) as it didn't neatly fit my matrix }; byte rowPins[ROWS] = {8,9,10,11}; //connect to the row pinouts of the keypad byte colPins[COLS] = {4,5,6,7}; //connect to the column pinouts of the keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup(){ DcsBios::setup(); Serial.begin(9600); keypad.addEventListener(keypadEvent); // Add an event listener for this keypad } void loop(){ DcsBios::loop(); char key = keypad.getKey(); } void keypadEvent(KeypadEvent KEY){ switch (keypad.getState()) { // gives PRESSED, HOLD or RELEASED case PRESSED: switch(KEY){ case '1': sendDcsBiosMessage("UFC_1", "1"); break; case '2': sendDcsBiosMessage("UFC_2", "1"); break; case '3': sendDcsBiosMessage("UFC_3", "1"); break; case '4': sendDcsBiosMessage("UFC_4", "1"); break; case '5': sendDcsBiosMessage("UFC_5", "1"); break; case '6': sendDcsBiosMessage("UFC_6", "1"); break; case '7': sendDcsBiosMessage("UFC_7", "1"); break; case '8': sendDcsBiosMessage("UFC_8", "1"); break; case '9': sendDcsBiosMessage("UFC_9", "1"); break; case '0': sendDcsBiosMessage("UFC_0", "1"); break; case '*': sendDcsBiosMessage("UFC_CLR", "1"); break; case '#': sendDcsBiosMessage("UFC_ENT", "1"); break; case 'B': sendDcsBiosMessage("UFC_OS2", "1"); break; case 'C': sendDcsBiosMessage("UFC_OS3", "1"); break; case 'D': sendDcsBiosMessage("UFC_OS4", "1"); break; case 'E': sendDcsBiosMessage("UFC_OS5", "1"); break; }} switch (keypad.getState()) { // gives PRESSED, HOLD or RELEASED case RELEASED: switch(KEY){ case '1': sendDcsBiosMessage("UFC_1", "0"); break; case '2': sendDcsBiosMessage("UFC_2", "0"); break; case '3': sendDcsBiosMessage("UFC_3", "0"); break; case '4': sendDcsBiosMessage("UFC_4", "0"); break; case '5': sendDcsBiosMessage("UFC_5", "0"); break; case '6': sendDcsBiosMessage("UFC_6", "0"); break; case '7': sendDcsBiosMessage("UFC_7", "0"); break; case '8': sendDcsBiosMessage("UFC_8", "0"); break; case '9': sendDcsBiosMessage("UFC_9", "0"); break; case '0': sendDcsBiosMessage("UFC_0", "0"); break; case '*': sendDcsBiosMessage("UFC_CLR", "0"); break; case '#': sendDcsBiosMessage("UFC_ENT", "0"); break; case 'B': sendDcsBiosMessage("UFC_OS2", "0"); break; case 'C': sendDcsBiosMessage("UFC_OS3", "0"); break; case 'D': sendDcsBiosMessage("UFC_OS4", "0"); break; case 'E': sendDcsBiosMessage("UFC_OS5", "0"); break; }} }
  2. G'day blokes and blokettes, Awesome thread here really love seeing everyone's success. Han, or anyone able to explain why this code below would not communicate with DCS at all? I am using a MEGA2560 board. My matrix is wired like the screenshot attached, the only difference being which pins the rows and columns are connected to (they are wired as per the code below). I tried wiring buttons individually to pins through a diode (1N4001) with the cathode pointing to the rows, and that didn't work either when I used the generic Control Reference codes in the #define DCSBIOS_DEFAULT_SERIAL. Both methods don't work with IRQ_SERIAL either. When I say it doesn't work, I mean I get zero response, not even ghosting etc. DCS BIOS is configured correctly, I get virtual cockpit connection and COMM connection through the correct port etc. and the code verifies and successfully uploads to the board. This is for an F18 UFC using the control reference for the 'CASE' SendDcsBiosMessage lines. Cheers in advance. #define DCSBIOS_DEFAULT_SERIAL #include <Keypad.h> #include <DcsBios.h> const byte ROWS = 4; //four rows const byte COLS = 4; //four columns char keys[ROWS][COLS] = { {'1','2','3','B'}, {'4','5','6','C'}, {'7','8','9','D'}, {'*','0','#','E'} //ufc keypad minus the top right option select (A) as it didn't neatly fit my matrix }; byte rowPins[ROWS] = {8,9,10,11}; //connect to the row pinouts of the keypad byte colPins[COLS] = {4,5,6,7}; //connect to the column pinouts of the keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup(){ DcsBios::setup(); Serial.begin(9600); keypad.addEventListener(keypadEvent); // Add an event listener for this keypad } void loop(){ DcsBios::loop(); char key = keypad.getKey(); } void keypadEvent(KeypadEvent KEY){ switch (keypad.getState()) { // gives PRESSED, HOLD or RELEASED case PRESSED: switch(KEY){ case '1': sendDcsBiosMessage("UFC_1", "1"); break; case '2': sendDcsBiosMessage("UFC_2", "1"); break; case '3': sendDcsBiosMessage("UFC_3", "1"); break; case '4': sendDcsBiosMessage("UFC_4", "1"); break; case '5': sendDcsBiosMessage("UFC_5", "1"); break; case '6': sendDcsBiosMessage("UFC_6", "1"); break; case '7': sendDcsBiosMessage("UFC_7", "1"); break; case '8': sendDcsBiosMessage("UFC_8", "1"); break; case '9': sendDcsBiosMessage("UFC_9", "1"); break; case '0': sendDcsBiosMessage("UFC_0", "1"); break; case '*': sendDcsBiosMessage("UFC_CLR", "1"); break; case '#': sendDcsBiosMessage("UFC_ENT", "1"); break; case 'B': sendDcsBiosMessage("UFC_OS2", "1"); break; case 'C': sendDcsBiosMessage("UFC_OS3", "1"); break; case 'D': sendDcsBiosMessage("UFC_OS4", "1"); break; case 'E': sendDcsBiosMessage("UFC_OS5", "1"); break; }} switch (keypad.getState()) { // gives PRESSED, HOLD or RELEASED case RELEASED: switch(KEY){ case '1': sendDcsBiosMessage("UFC_1", "0"); break; case '2': sendDcsBiosMessage("UFC_2", "0"); break; case '3': sendDcsBiosMessage("UFC_3", "0"); break; case '4': sendDcsBiosMessage("UFC_4", "0"); break; case '5': sendDcsBiosMessage("UFC_5", "0"); break; case '6': sendDcsBiosMessage("UFC_6", "0"); break; case '7': sendDcsBiosMessage("UFC_7", "0"); break; case '8': sendDcsBiosMessage("UFC_8", "0"); break; case '9': sendDcsBiosMessage("UFC_9", "0"); break; case '0': sendDcsBiosMessage("UFC_0", "0"); break; case '*': sendDcsBiosMessage("UFC_CLR", "0"); break; case '#': sendDcsBiosMessage("UFC_ENT", "0"); break; case 'B': sendDcsBiosMessage("UFC_OS2", "0"); break; case 'C': sendDcsBiosMessage("UFC_OS3", "0"); break; case 'D': sendDcsBiosMessage("UFC_OS4", "0"); break; case 'E': sendDcsBiosMessage("UFC_OS5", "0"); break; }} }
  3. Hi, I just passed the AFT05 - Illum Flare mission, went and had lunch, came back to progress to the next mission and it says the campaign is inactive. Read through this thread and there is a post further up by the mission author, about manually advancing campaign by adjusting logbook.lua files (the actual link no longer works so I cant use it)...so I went and checked that, and there is no mission data in the logbook.lua Can someone please send me the code up to and including the completion of AFT05 so I don't have to repeat it all :( I'd consider myself a complete and utter novice when it comes to editing notepad files so all the help I can get regarding that would be great. Thanks in advance
×
×
  • Create New...