Jump to content

Recommended Posts

Posted

None of my pots work, so I guess I messed up the wiring. How should they be wired? Just 2 wires, ground and to a pin, or 3 wires ground, 5v and to a pin? 

Posted
1 hour ago, MarkBLN said:

None of my pots work, so I guess I messed up the wiring. How should they be wired? Just 2 wires, ground and to a pin, or 3 wires ground, 5v and to a pin? 

3 wires.

Posted
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?

Posted (edited)

"LEDpin" is the constant for it.
You can either replace that with the number, or put this at the beginning of your code:

#define LEDpin 3  // 3 is the LED's pin number

Edited by No1sonuk
Posted

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. 

Posted
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?

Posted

Sorry, I forgot the == thing.

As for the dim light, it might be turning on and off very quickly for some reason, rather than staying on.

Try !=1  in the if statement and switching the HIGH and LOW.

  • Thanks 1
Posted (edited)

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
Posted

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.

Posted (edited)

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
  • 2 weeks later...
Posted
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

Posted

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]

Posted

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

Posted
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.

Posted

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();
}

 

 

 

Posted
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.

Posted
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

Posted
1 hour ago, No1sonuk said:

Is that after starting a mission/flight?

No before. after i hit continue, nothing happens. With the Mega, i see data scrolling.

Posted

Don't use those two pins, ever!

Wayne

Wayne Wilson

AKA: hrnet940

Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.

Posted
10 hours ago, hrnet940 said:

Don't use those two pins, ever!

Wayne

I have confirmed with Arduino that those two pins can be used for Digital I/O. Why do you say do not use?

Posted

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

Kind regards

Hans Dieter

Intel® Core™ Ultra 5 245KF, ASUS ROG STRIX B860-A GAMING WIFI, Mainboard, ASUS PRIME LC 240 ARGB, Wasserkühlung, Corsair DIMM 64 GB DDR5-5200 (2x 32 GB) DualKit, Arbeitsspeicher, SAMSUNG 990 EVO Plus 2 TB, SSD, Thermaltake Toughpower GF A3 Snow 1050W, PC-Netzteil, ZOTAC GeForce RTX 5060 Ti Twin Edge OC 16GB, Grafikkarte  --  Patch: 2.9 uptodate

 

 

  • Recently Browsing   0 members

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