Bjer006 Posted May 5, 2023 Posted May 5, 2023 I feel this is a very basic task and I cant figure out why I cannot upload LED switches with its correct switch. For instance the A/A mode on the FA-18 I want it to turn on an LED. When I upload the codes, it get a "Confliction Declaration" error. This is happening with a lot of the switches and LEDs, even though they are on different pins. Please advise what simple thing I'm missing, thanks! /* 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" DcsBios::Switch2Pos masterModeAa("MASTER_MODE_AA", 13); DcsBios::LED masterModeAa(0x740c, 0x0800, 5); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); ERROR received: C:\Users\xxxx\AppData\Local\Temp\.arduinoIDE-unsaved202345-21032-131106u.wt76\IRQSerial\IRQSerial.ino:14:26: error: conflicting declaration 'DcsBios::LED masterModeAa' DcsBios::LED masterModeAa(0x740c, 0x0800, 5); ^ C:\Users\xxxx\AppData\Local\Temp\.arduinoIDE-unsaved202345-21032-131106u.wt76\IRQSerial\IRQSerial.ino:13:21: note: previous declaration as 'DcsBios::Switch2Pos masterModeAa' DcsBios::Switch2Pos masterModeAa("MASTER_MODE_AA", 13); ^~~~~~~~~~~~ exit status 1 Compilation error: conflicting declaration 'DcsBios::LED masterModeAa'
lesthegrngo Posted May 6, 2023 Posted May 6, 2023 Hi, you cannot have two separate things called 'LED masterModeAa' You have both a switch and an LED calling out the same - rename one Les
No1sonuk Posted May 6, 2023 Posted May 6, 2023 To clarify Les's post, it's the "masterModeAa" part that can't be duplicated. Those names directly before the parenthesis aren't fixed in game code, so you can change them if required. Try this instead: DcsBios::Switch2Pos masterModeAa("MASTER_MODE_AA", 13); DcsBios::LED masterModeAaLED(0x740c, 0x0800, 5); //added "LED" to the name declaration "masterModeAa" to remove the conflict with the switch
Recommended Posts