Jump to content

DCS-BIOS Discussion Thread


FSFIan

Recommended Posts

21 hours ago, No1sonuk said:

OR:

void onSelJettKnobChange(unsigned int newValue) {

  if (newValue = 1) { digitalWrite(LEDpin, LOW); } // 1 is the value for SAFE

  else { digitalWrite(LEDpin, HIGH); }

}
DcsBios::IntegerBuffer selJettKnobBuffer(0x7480, 0x0e00, 9, onSelJettKnobChange);

 

Where do I reference the pin for the LED I want to illuminate in this code?

Link to comment
Share on other sites

I tried the code with that and didn't work. I tired some other code to just get the light to light up and it's lighting fine, so seems the code isn't right for what I'm trying to do sadly. I'll mess around more tomorrow and see if I have any luck. 

 

Thanks for the help. 

Link to comment
Share on other sites

On 4/22/2023 at 10:29 PM, No1sonuk said:

OR:

void onSelJettKnobChange(unsigned int newValue) {

  if (newValue = 1) { digitalWrite(LEDpin, LOW); } // 1 is the value for SAFE

  else { digitalWrite(LEDpin, HIGH); }

}
DcsBios::IntegerBuffer selJettKnobBuffer(0x7480, 0x0e00, 9, onSelJettKnobChange);

 

Thanks mate, this worked once I added == instead of =

 

Happy to have it all working now though.

One funny issue is that when the button LED is triggered by the above command the light is very dim, whereas if I use some code to let's say just light the button when the landing gear is down then it is fully bright. I can't figure out what is it about this specific code that limits the light output of the LED?

Link to comment
Share on other sites

Figured it out. 

 

in the section at the end that says..

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


I added...

pinMode(A13, OUTPUT);    
  pinMode(A14, OUTPUT);    
  pinMode(15, OUTPUT);

 

Now the LEDs are full brightness. 

 

Here's the finished result. 

 

IMG_20230424_004341.jpg

IMG_20230424_004351.jpg

IMG_20230424_004407.jpg

Made from MDF, HDF, carbon fiber foil, pin striping tape and a hand label punch. Only have a handsaw and battery screwdriver that I borrowed from a mate 😁 So I'm happy with the result considering the limited resources. 


Edited by MarkBLN
Link to comment
Share on other sites

Nice job. Especially with the limited tools.

Setting the pin modes is something else I forgot.

DCS-BIOS does it automatically when it's a built-in function, but the code within the onchange functions doesn't. This is because it's a normal Arduino code function.

Having said that, I think there's a difference in the analogue pins.

Link to comment
Share on other sites

Cheers. Ya the problem was the code I was using wasn't specifically referring to LEDs. The issue was on both digital and analog pins. 

 

The 2 different cases I had was firstly, I wanted the backlit selective jettison button to be off when the select jettison dial was set to safe, then illuminate when set to any other setting apart from safe. That's the one you helped me with the code for. 

 

The other case was to mimic a magnetic switch for the engine crank. I have 2 LEDs, one each side of the crank switch. My switch is momentary, not latched. So how it works is when I press it to the right the in game switch moves to the right and latches, then my right hand light illuminates to simulate this. Then when the engine has started successfully and the ingame switch is released to centre, the right hand light goes off. Then this is repeated with the left side. 

So ya, both of those sets of LEDs were the ones that were dim until I put in the code to specify that they were output pins. 


Edited by MarkBLN
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
Am 21.4.2023 um 19:22 schrieb No1sonuk:

When you run the Hub installer, it does it for you.
On the Tek Creations link, there's another to the DCS-BIOS Hub installation instructions.

I don't remember exactly what happens with the install, and I don't use Hub any more as it's woefully out of date.
It looks like they created their own Hub plug-in too.

Hello, it's me again.

Kieron from Tek Creation can't figure out what's going on either. The problem is that DCS doesn't seem to be sending any data to the Bios Hub. Although the program displays Virtual Cockpit.

Apparently the rest is o.k.

Maybe someone has an idea

Link to comment
Share on other sites

Same here.

Flightpanel's version of DcsBios is not sending data for the A-10C II. Socat is running normal, data are shown.

In contradiction to that, for the F-16 and Bf-109 all seem okay and data can be received by an Arduino.

No idea so far.

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

On 5/12/2023 at 10:03 AM, Neville said:

Thanks for the answer.

But that doesn't explain to me why my dcs and the dcs bios aren't communicating data with each other.

my Dcs is on drive E and the savegame on C, maybe that's the problem

I have them split between different drives myself.  That's not the problem.

It's more likely that the Hub version of DCS-BIOS doesn't work properly anymore after the many DCS updates since Hub went unmaintained.

Don't forget the A-10CII just had a major update with the ARC-210 being implemented.  That's likely had a knock-on effect on the rest of the code for that aircraft.

Link to comment
Share on other sites

Anybody have issues with the ELEGOO UNO R3?  First time using this Arduino UNO from amazon. Just finished uploading the code for the Fuel Control Panel and it seems to hang when starting DCS-BIOS Fork version.

Computer is detecting Arduino correctly. Tried one of my other panels and DCS-BIOS works fine.

Using latest BSC-BIOS Fork. Below is code.

 

thanks in advance!

 

#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"


// FUEL CONTROL PANEL
// Aerial Refueling Slipway Control Lever
DcsBios::RotaryEncoder fscpRcvrLever("FSCP_RCVR_LEVER", "DEC", "INC", 12, 11);

// Boost Pumps Left Wing
DcsBios::Switch2Pos fscpBoostWingL("FSCP_BOOST_WING_L", 15);

// Boost Pumps Right Wing
DcsBios::Switch2Pos fscpBoostWingR("FSCP_BOOST_WING_R", 14);

// Boost Pumps Main Fuselage Left
DcsBios::Switch2Pos fscpBoostMainL("FSCP_BOOST_MAIN_L", 19);

//Boost Pumps Main Fuselage Right
DcsBios::Switch2Pos fscpBoostMainR("FSCP_BOOST_MAIN_R", 18);

// Crossfeed
DcsBios::Switch2Pos fscpCrossfeed("FSCP_CROSSFEED", 2);

//External Fuselage Tanks Boost Pumps
DcsBios::Switch2Pos fscpExtTanksFus("FSCP_EXT_TANKS_FUS", 1);

// External Wing Tanks Boost Pumps
DcsBios::Switch2Pos fscpExtTanksWing("FSCP_EXT_TANKS_WING", 16);

//Fill Disable Main Left
DcsBios::Switch2Pos fscpFdMainL("FSCP_FD_MAIN_L", 6);

//Fill Disable Main Right
DcsBios::Switch2Pos fscpFdMainR("FSCP_FD_MAIN_R", 5);

//Fill Disable Wing Left
DcsBios::Switch2Pos fscpFdWingL("FSCP_FD_WING_L", 4);

// Fill Disable Wing Right
DcsBios::Switch2Pos fscpFdWingR("FSCP_FD_WING_R", 3);

// Line Check
DcsBios::Switch2Pos fscpLineCheck("FSCP_LINE_CHECK", 13);

// Signal Amplifier NORM - OVERRIDE
DcsBios::Switch2Pos fscpAmpl("FSCP_AMPL", 0);

// TK Gate
DcsBios::Switch2Pos fscpTkGate("FSCP_TK_GATE", 17);


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

}

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

 

 

 

Link to comment
Share on other sites

41 minutes ago, byteman59 said:

Anybody have issues with the ELEGOO UNO R3?  First time using this Arduino UNO from amazon. Just finished uploading the code for the Fuel Control Panel and it seems to hang when starting DCS-BIOS Fork version.

Computer is detecting Arduino correctly. Tried one of my other panels and DCS-BIOS works fine.

Using latest BSC-BIOS Fork. Below is code.


//External Fuselage Tanks Boost Pumps
DcsBios::Switch2Pos fscpExtTanksFus("FSCP_EXT_TANKS_FUS", 1);

// Signal Amplifier NORM - OVERRIDE

DcsBios::Switch2Pos fscpAmpl("FSCP_AMPL", 0);

You're using pins 0 and 1.  That disrupts the data connection because they're the pins the Atmega328p uses to communicate with the USB controller.

Try disconnecting those two switches.

Link to comment
Share on other sites

5 hours ago, No1sonuk said:

You're using pins 0 and 1.  That disrupts the data connection because they're the pins the Atmega328p uses to communicate with the USB controller.

Try disconnecting those two switches.

Same result.image.png

Link to comment
Share on other sites

Anyone who can give me a DCS_BIOS-script for an on/off-function of the F-16 speed-brake?

Kind regards

Hans Dieter

System: Win 11 Prof, 64 Bit, AMD 4350 Quad-Core, Gigabyte-Board 970A-UD3P, 16 GB-RAM; ASUS GTX 1080 8 GB - Nvidia Geforce

Link to comment
Share on other sites

  • Recently Browsing   0 members

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