Jump to content

Recommended Posts

Posted

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'

Posted

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

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...