So I finally got my panel built and wired up and just doing the code now with DCS bios and the mega. I went to upload but I am getting some errors. If I post the code here can someone have a look and see what the errors are? I am totally clueless so would appreciate any help with this.
/*
Tell DCS-BIOS to use a serial connection and use interrupt-driven
communication. The main program will be interrupted to prioritize
processing incoming data.
This should work on any Arduino that has an ATMega328 controller
(Uno, Pro Mini, many others).
*/
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
/* paste code snippets from the reference documentation here */
/* PIN 2 */
DcsBios::ActionButton selJettBtn("SEL_JETT_BTN", "1", 2);
/* PIN 3, 4, 5, 6, 7 */
const byte selJettKnobPins[5] = {3, 4, 5, 6, 7};
DcsBios::SwitchMultiPos selJettKnob("SEL_JETT_KNOB", selJettKnobPins, 5);
/* PIN 8 */
DcsBios::Switch2Pos ldgTaxiSw("LDG_TAXI_SW", 8);
/* PIN 9, 10 */
DcsBios::Switch3Pos flapSw("FLAP_SW", 9, 10);
/* PIN 11 */
DcsBios::Switch2Pos gearLever("GEAR_LEVER", 11);
/* PIN 12 */
DcsBios::Switch2Pos launchBarSw("LAUNCH_BAR_SW", 12);
/* PIN 13 */
DcsBios::Switch2Pos antiSkidSw("ANTI_SKID_SW", 13);
/* PIN 14 */
DcsBios::Switch2Pos hookBypassSw("HOOK_BYPASS_SW", 14);
/* PIN 15 */
DcsBios::LED selJettBtn(0x7480, 0x0100, 15);
/* PIN 16 */
DcsBios::LED flpLgRightGearLt(0x7430, 0x2000, 16);
/* PIN 17 */
DcsBios::Switch2Pos pitotHeatSw("PITOT_HEAT_SW", 17);
/* PIN 18, 19 */
DcsBios::Switch3Pos engAntiiceSw("ENG_ANTIICE_SW", 18, 19);
/* PIN 20, 21 */
DcsBios::Switch3Pos wshieldAntiIceSw("WSHIELD_ANTI_ICE_SW", 20, 21);
/* PIN 22 */
DcsBios::Switch2Pos hookLever("HOOK_LEVER", 22);
/* PIN 23, 24 */
DcsBios::Switch3Pos cockkpitLightModeSw("COCKKPIT_LIGHT_MODE_SW", 23, 24);
/* PIN 25, 26 */
DcsBios::Switch3Pos probeSw("PROBE_SW", 25, 26);
/* PIN 27, 28 */
DcsBios::Switch3Pos extWngTankSw("EXT_WNG_TANK_SW", 27, 28);
/* PIN 29, 30 */
DcsBios::Switch3Pos extCntTankSw("EXT_CNT_TANK_SW", 29, 30);
/* PIN 31 */
DcsBios::ActionButton fuelDumpSw("FUEL_DUMP_SW", "1", 31);
/* PIN 32, 33 */
DcsBios::Switch3Pos flirSw("FLIR_SW", 32, 33);
/* PIN 34 */
DcsBios::ActionButton ltdRSw("LTD_R_SW", "1", 34);
/* PIN 35 */
DcsBios::Switch2Pos lstNflrSw("LST_NFLR_SW", 35);
/* PIN 36, 37 */
DcsBios::Switch3Pos strobeSw("STROBE_SW", 36, 37);
/* PIN 38, 39, 40 */
const byte radarSwPins[4] = {38, 39, 40};
DcsBios::SwitchMultiPos radarSw("RADAR_SW", radarSwPins, 3);
/* PIN 41, 42, 43, 44 */
const byte insSwPins[8] = {41, 42, 43, 44};
DcsBios::SwitchMultiPos insSw("INS_SW", insSwPins, 4);
/* PIN 45 */
DcsBios::Switch2Pos gainSwitch("GAIN_SWITCH", 45);
/* PIN 46 */
DcsBios::ActionButton fcsResetBtn("FCS_RESET_BTN", "1", 46);
/* PIN 47, 48 */
DcsBios::Switch3Pos batterySw("BATTERY_SW", 47, 48);
/* PIN 49 */
DcsBios::ActionButton apuControlSw("APU_CONTROL_SW", "1", 49);
/* PIN 50, 51 */
DcsBios::Switch3Pos engineCrankSw("ENGINE_CRANK_SW", 51, 50);
/* PIN 52 */
DcsBios::Switch2Pos obogsSw("OBOGS_SW", 52);
/* PIN A0 */
DcsBios::Potentiometer hmdOffBrt("HMD_OFF_BRT", A0);
/* PIN A1 */
DcsBios::Potentiometer floodDimmer("FLOOD_DIMMER", A1);
/* PIN A2 */
DcsBios::Potentiometer instPnlDimmer("INST_PNL_DIMMER", A2);
/* PIN A3 */
DcsBios::Potentiometer consolesDimmer("CONSOLES_DIMMER", A3);
/* PIN A4 */
DcsBios::Potentiometer formationDimmer("FORMATION_DIMMER", A4);
/* PIN A5 */
DcsBios::Potentiometer positionDimmer("POSITION_DIMMER", A5);
/* PIN A6 */
DcsBios::LED fuelDumpSw(0x74b4, 0x0100, A6);
/* PIN A7 */
DcsBios::LED batterySw(0x74c4, 0x1800, A7);
/* PIN A8 */
DcsBios::LED apuControlSw(0x74c2, 0x0100, A8);
/* PIN A9 */
DcsBios::ActionButton fuelDumpSw("FUEL_DUMP_SW", "0", A9);
/* PIN A10 */
DcsBios::ActionButton ltdRSw("LTD_R_SW", "0", A10);
/* PIN A11 */
DcsBios::LED ltdRSw(0x74c8, 0x4000, A11);
/* PIN A12 */
DcsBios::ActionButton apuControlSw("APU_CONTROL_SW", "0", A12);
/* PIN A13 */
void onEngineCrankSwChange(unsigned int newValue) {DcsBios::LED engineCrankSwBuffer(0x74c2, 0x0600, A13);}DcsBios::IntegerBuffer engineCrankSwBuffer(0x74c2, 0x0600, 9, onEngineCrankSwChange);
/* PIN A14 */
void onEngineCrankSwChange(unsigned int newValue) {DcsBios::LED engineCrankSwBuffer(0x74c2, 0x0600, A14);}DcsBios::IntegerBuffer engineCrankSwBuffer(0x74c2, 0x0600, 9, onEngineCrankSwChange);
void setup() {
DcsBios::setup();
}
void loop() {
DcsBios::loop();
}
These are the errors I am getting...
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:41:24: error: conflicting declaration 'DcsBios::LED selJettBtn'
DcsBios::LED selJettBtn(0x7480, 0x0100, 15);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:16:23: note: previous declaration as 'DcsBios::ActionButton selJettBtn'
DcsBios::ActionButton selJettBtn("SEL_JETT_BTN", "1", 2);
^~~~~~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:130:24: error: conflicting declaration 'DcsBios::LED fuelDumpSw'
DcsBios::LED fuelDumpSw(0x74b4, 0x0100, A6);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:71:23: note: previous declaration as 'DcsBios::ActionButton fuelDumpSw'
DcsBios::ActionButton fuelDumpSw("FUEL_DUMP_SW", "1", 31);
^~~~~~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:133:23: error: conflicting declaration 'DcsBios::LED batterySw'
DcsBios::LED batterySw(0x74c4, 0x1800, A7);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:100:21: note: previous declaration as 'DcsBios::Switch3Pos batterySw'
DcsBios::Switch3Pos batterySw("BATTERY_SW", 47, 48);
^~~~~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:136:26: error: conflicting declaration 'DcsBios::LED apuControlSw'
DcsBios::LED apuControlSw(0x74c2, 0x0100, A8);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:103:23: note: previous declaration as 'DcsBios::ActionButton apuControlSw'
DcsBios::ActionButton apuControlSw("APU_CONTROL_SW", "1", 49);
^~~~~~~~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:139:33: error: redefinition of 'DcsBios::ActionButton fuelDumpSw'
DcsBios::ActionButton fuelDumpSw("FUEL_DUMP_SW", "0", A9);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:71:23: note: 'DcsBios::ActionButton fuelDumpSw' previously declared here
DcsBios::ActionButton fuelDumpSw("FUEL_DUMP_SW", "1", 31);
^~~~~~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:142:29: error: redefinition of 'DcsBios::ActionButton ltdRSw'
DcsBios::ActionButton ltdRSw("LTD_R_SW", "0", A10);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:77:23: note: 'DcsBios::ActionButton ltdRSw' previously declared here
DcsBios::ActionButton ltdRSw("LTD_R_SW", "1", 34);
^~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:145:20: error: conflicting declaration 'DcsBios::LED ltdRSw'
DcsBios::LED ltdRSw(0x74c8, 0x4000, A11);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:77:23: note: previous declaration as 'DcsBios::ActionButton ltdRSw'
DcsBios::ActionButton ltdRSw("LTD_R_SW", "1", 34);
^~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:148:35: error: redefinition of 'DcsBios::ActionButton apuControlSw'
DcsBios::ActionButton apuControlSw("APU_CONTROL_SW", "0", A12);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:103:23: note: 'DcsBios::ActionButton apuControlSw' previously declared here
DcsBios::ActionButton apuControlSw("APU_CONTROL_SW", "1", 49);
^~~~~~~~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino: In function 'void onEngineCrankSwChange(unsigned int)':
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:154:6: error: redefinition of 'void onEngineCrankSwChange(unsigned int)'
void onEngineCrankSwChange(unsigned int newValue) {DcsBios::LED engineCrankSwBuffer(0x74c2, 0x0600, A14);}DcsBios::IntegerBuffer engineCrankSwBuffer(0x74c2, 0x0600, 9, onEngineCrankSwChange);
^~~~~~~~~~~~~~~~~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:151:6: note: 'void onEngineCrankSwChange(unsigned int)' previously defined here
void onEngineCrankSwChange(unsigned int newValue) {DcsBios::LED engineCrankSwBuffer(0x74c2, 0x0600, A13);}DcsBios::IntegerBuffer engineCrankSwBuffer(0x74c2, 0x0600, 9, onEngineCrankSwChange);
^~~~~~~~~~~~~~~~~~~~~
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino: At global scope:
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:154:149: error: redefinition of 'DcsBios::IntegerBuffer engineCrankSwBuffer'
void onEngineCrankSwChange(unsigned int newValue) {DcsBios::LED engineCrankSwBuffer(0x74c2, 0x0600, A14);}DcsBios::IntegerBuffer engineCrankSwBuffer(0x74c2, 0x0600, 9, onEngineCrankSwChange);
^
C:\Users\marka\Documents\Arduino\F18Panel\F18Panel.ino:151:130: note: 'DcsBios::IntegerBuffer engineCrankSwBuffer' previously declared here
void onEngineCrankSwChange(unsigned int newValue) {DcsBios::LED engineCrankSwBuffer(0x74c2, 0x0600, A13);}DcsBios::IntegerBuffer engineCrankSwBuffer(0x74c2, 0x0600, 9, onEngineCrankSwChange);
^~~~~~~~~~~~~~~~~~~
exit status 1
Compilation error: conflicting declaration 'DcsBios::LED selJettBtn'