Jump to content

Recommended Posts

Posted

Hi all,

 

I'm having a bit of a problem with trying to display the status of the P51 parking brake handle on my Arduino's LED.

The end goal is to implement what amounts to a magnetic switch.

 

I've got a few ideas for the mechanical and electronic hardware aspects, but I'm having trouble with the code part.

 

After a few attempts at more complex solutions, I decided to strip back to what should be so basic it couldn't fail:

#define DCSBIOS_IRQ_SERIAL

#include "DcsBios.h"

/* paste code snippets from the reference documentation here */


DcsBios::Switch2Pos parkBrakeHandleSwitch("PARK_BRAKE_HANDLE", 10);
DcsBios::LED parkBrakeHandle(0x5022, 0x0002, 13);

void setup() {
 DcsBios::setup();
}

void loop() {
 DcsBios::loop();
}

This code sort of works - the Arduino's switch changes the state of the handle in DCS, but the LED display part doesn't work.

I have confirmed my setup normally would work using the A-10 Master caution example code.

 

Any ideas?

Posted
Hi there, can you send me the P51 .json file, then I can take a look using it and see if I can make a working sketch for you

 

Cheers

 

Les

Hi Les,

It's the "TF-51D" that comes with the base game - I can't find a specific .json that looks like it has anything useful in it.

 

Tim

Posted

I did a quick test of my connections using the A-10 APU RPM gauge.

 

This all works:

#define DCSBIOS_IRQ_SERIAL


#include <Servo.h>
#include "DcsBios.h"

/* paste code snippets from the reference documentation here */

DcsBios::ServoOutput apuRpm(0x10be, 9, 544, 2400);
DcsBios::Switch2Pos ufcMasterCaution("UFC_MASTER_CAUTION", 10);
DcsBios::LED masterCaution(0x1012, 0x0800, 13);

void setup() {
 DcsBios::setup();

}

void loop() {
 DcsBios::loop();

  
}

However, if I replace the pin defines with this, the light test switch works, but the servo and light doesn't:

DcsBios::Switch2Pos unsafeLndGearLtTest("UNSAFE_LND_GEAR_LT_TEST", 10);
DcsBios::LED landingGearRed(0x500e, 0x4000, 13);
DcsBios::ServoOutput engineRpm(0x5072, 9, 544, 2400);

I'm thinking there must be something wrong with the P51 export somewhere.

Posted

Well I was kind of right - It looks like I was using an old version of DCS-BIOS.

I cleared what I had and went through the installation using the hub thing (which I hadn't before) and now everything that wasn't working is.

  • Recently Browsing   0 members

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