Jump to content

Noob pit building help


eatthis

Recommended Posts

Right im looking to build a semi generic pit (ie NOT plane specific, mostly based on tomcat but i fly other stuff too, mainly f16, f18 and huey) 
heres where im at so far with my understanding
1 physical layout ie what buttons. switches, rotary encoders etc are going where. thats long winded and complicated but i know what im doing there at least, and i can do basic cad and 3d print the panels

2  arduinos and multiplexers, christ this is a bottomless pit of randomness. where im at so far is i know what a multiplexer is and how it works physically, i have no idea how to set them up for the arduinos though. i can use them for momentary switches and analog inputs but not on else off toggle switches, im not sure if i can use normal on off on toggles with them though.

3 dcs bios. this is the interface that exports ingame data to the arduinos, another massive can of worms that iv no idea how to use. so far the 1st stage doesnt match the instructions at all lol, i dont get the options im supposed to right off the bat lol.

iv found and installed code with f14 f16 f18 and huey into dcs bios but im clueless as to how it works.
So far im thinking this
use bigger arduinos/bodner boards as hid devices to simply connect switches (with multiplexers on the arduinos to get even more switches if needed) and bind them directly (iv already done this with bodner boards which are plug and play and iv written some code ingame to change/add controls too which was nice).
use arduino nanos to use all the displays 
i do want a few lcds/oleds/7 seg displays for stuff, mainly radios, tacan, iff in the f16 (can i use the 1 i use  for tacan in the tomcat as the iff in the f16??)
and the ded on the f16/f18 

any and all noob advice/tips welcome


Edited by eatthis

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

  • eatthis changed the title to Noob pit building help

WRT DCS BIOS:  Use the "Flight panels Fork", not "Hub".  Hub is no longer maintained and is increasingly not working properly as DCS updates.
The Flightpanels Fork is actively maintained, despite having a lower version number than Hub.

Good setup and start video here:

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, No1sonuk said:

WRT DCS BIOS:  Use the "Flight panels Fork", not "Hub".  Hub is no longer maintained and is increasingly not working properly as DCS updates.
The Flightpanels Fork is actively maintained, despite having a lower version number than Hub.

Good setup and start video here:

 

i dont know what you mean yet but thanks for the link. il check it out

thats a great video! 
am i right in thinking dcs bios outputs direct to the arduino and i can can set the controls in there manually AND/OR ingame? 
can i use the saem switch and arduino for different ingame modules, ie master arm switch on the f14 and f18 on the same physical switch in my pit?


Edited by eatthis

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

37 minutes ago, eatthis said:

am i right in thinking dcs bios outputs direct to the arduino and i can can set the controls in there manually AND/OR ingame? 
can i use the saem switch and arduino for different ingame modules, ie master arm switch on the f14 and f18 on the same physical switch in my pit?

Yes. Sort of. 😁

e.g.:

DcsBios::Switch2Pos pltMasterCautionReset("PLT_MASTER_CAUTION_RESET", 2);
DcsBios::Switch2Pos masterCautionResetSw("MASTER_CAUTION_RESET_SW", 2);

This will reset the Master Caution alarm on the F14 and F18 using one switch on pin 2.
It will send both commands, but DCS will just ignore the one not meant for the module you're using.
You can stack more, but there are a couple of caveats:

1. The names before the parentheses must be unique.  Those names are not fixed in the BIOS, so they can be set by you. If you have two the same, change at least one of them. e.g. masterCautionResetSw and masterCautionResetSw_1

2. The parts in quotes, e.g. "MASTER_CAUTION_RESET_SW" are what DCS responds to and cannot be changed.  HOWEVER, if your code lines contain duplicates of this argument, you only need one of those lines - all aircraft that use that name will respond to the one line.
e.g.

DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // F16
DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // AJS37

DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // A10
DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // F18

Would fail to compile because the names before the parentheses are duplicated.  It can be corrected and simplified to this:

DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // F16 and AJS37

DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // A10 and F18


Other options, such as Lep Bodnar boards or other HIDs, can be set in DCS.

  • Like 3
Link to comment
Share on other sites

8 hours ago, No1sonuk said:

Yes. Sort of. 😁

e.g.:

DcsBios::Switch2Pos pltMasterCautionReset("PLT_MASTER_CAUTION_RESET", 2);
DcsBios::Switch2Pos masterCautionResetSw("MASTER_CAUTION_RESET_SW", 2);

This will reset the Master Caution alarm on the F14 and F18 using one switch on pin 2.
It will send both commands, but DCS will just ignore the one not meant for the module you're using.
You can stack more, but there are a couple of caveats:

1. The names before the parentheses must be unique.  Those names are not fixed in the BIOS, so they can be set by you. If you have two the same, change at least one of them. e.g. masterCautionResetSw and masterCautionResetSw_1

2. The parts in quotes, e.g. "MASTER_CAUTION_RESET_SW" are what DCS responds to and cannot be changed.  HOWEVER, if your code lines contain duplicates of this argument, you only need one of those lines - all aircraft that use that name will respond to the one line.
e.g.

DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // F16
DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // AJS37

DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // A10
DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // F18

Would fail to compile because the names before the parentheses are duplicated.  It can be corrected and simplified to this:

DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // F16 and AJS37

DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // A10 and F18


Other options, such as Lep Bodnar boards or other HIDs, can be set in DCS.

that helps alot thanks, how do i know gear handle or gear lever will work correctly? what in the code points exactly at the command? i assume its the bracketed part but how does dcs exactly what it is

 

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

The way DCS and DCS-BIOS are written is what determines how those commands are interpreted.

At a bottom level, DCS-BIOS sends "GEAR_LEVER 1" to DCS if the switch is turned on or "GEAR_LEVER 0" if it's turned off. The switch2pos part is code that handles how to interpret the switch operation.

When you grab the code lines from the control reference, if the bracketed part is the same as one you already have, you don't need that new line.

Link to comment
Share on other sites

"DcsBios::Switch2Pos" means a switch with two positions - ON-OFF - 0 or 1 goes to DCS.
"DcsBios::Switch3Pos" means a switch with three positions - ON-OFF-ON (2 pins required) - 0, 1 or 2 goes to DCS.

For this line:

DcsBios::Switch2Pos pltMasterCautionReset("PLT_MASTER_CAUTION_RESET", 2);

"DcsBios::Switch2Pos" is the setup definition for a two position switch.
"pltMasterCautionReset" is the name of the control the arduino code uses - these must be unique in each sketch, but can be pretty much anything you want to call it.
"PLT_MASTER_CAUTION_RESET" Is the command sent to DCS with the switch state, as I described earlier.
"2" is the arduino pin number of the switch input.

"true" is missing from that line because it's not needed - true would make the switch work the other way round - sending "0" when pressed instead of "1".  It's defaulted to "false" so you only need to add that parameter if want to invert the output.

The control ref is an HTML document in the Scripts\DCS-BIOS\doc\ folder

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

 
iv tried to do this. got the hardware wired up on a breadboard but it doesnt work in arduino ide.
when i compile it i get this error
C:\Users\john\Documents\3d printing\stl files\pc cockpit build\f16\MFD.F16-main\src\MFD\MFD.ino:4:10: fatal error: Joystick.h: No such file or directory #include <Joystick.h> ^~~~~~~~~~~~ compilation terminated. exit status 1 Compilation error: Joystick.h: No such file or directory

does that mean its failing at the 1st line and not even bothering with the rest?? 
i have no idea what joystic.h is
 

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

5 minutes ago, lesthegrngo said:

Go to the IDE library manager and search for ‘joystick’ and you will see an option to download and install it

 

cheers

Led

 

i dont know how. is it in in ide itself or on tinternet? will it autoinstall to the right place? is it code that gets added to the sketch?
iv found a list, how do i know which 1 i should use? and do i add it the same way i add another library?


Edited by eatthis

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

24 minutes ago, lesthegrngo said:

Yes, in the IDE itself, I’m not in front of the Pc so can’t check, but if you go the drop down menus you will see it. 
 

it is easy once you get used to dealing with it, you will probably have to do it many times with all the DCS bios stuff!

 

cheers

 

Les

somehow i got the wrong file completely. i have no idea how lol.

got the right code i think, it compiled fine but wont uplaod to the nano, iv tried different usb ports and different nano boards too 

Sketch uses 7422 bytes (24%) of program storage space. Maximum is 30720 bytes.
Global variables use 1022 bytes (49%) of dynamic memory, leaving 1026 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x98
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x80
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe6
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x80
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x98
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x80
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe6
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x80
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x98
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x80
Failed uploading: uploading error: exit status 1

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

This is not a problem of your sketch. Looks like the COM port is busy.

If you have a serial monitor open, you must close it before uploading a sketch.

Otherwise try to disconnect and reconnect the Arduino or use another cable and confirm the right port for the upload in the IDE.

In some cases you may choose another bootloader (Old bootloader for the Nano) to solve the problem.

Regards, Vinc 


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

6 minutes ago, Vinc_Vega said:

This is not a problem of your sketch. Looks like the COM port is busy.

If you have a serial monitor open, you must close it before uploading a sketch.

Otherwise try to disconnect and reconnect the Arduino or use another cable and confirm the right port for the upload in the IDE.

In some cases you may choose another bootloader (Old bootloader for the Nano) to solve the problem.

Regards, Vinc 

 

whats a serial monitor? 
all the other nanos are greyed out in ide
its showing connected in the bottom right of the ide

 


Edited by eatthis

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

It's the connection to the Arduino over the serial protocol (USB) to talk to the programme. You may see text outputs of it or give keyboard inputs.

If you don't know, you probably don't left it open 😉

Did you already restart the IDE?

Regards, Vinc

 

Edit: The serial monitor also can be found under the menu item "Tools" and than "Serial Monitor". That way an open window can be closed too.


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

On 9/25/2023 at 4:32 PM, Vinc_Vega said:

It's the connection to the Arduino over the serial protocol (USB) to talk to the programme. You may see text outputs of it or give keyboard inputs.

If you don't know, you probably don't left it open 😉

Did you already restart the IDE?

Regards, Vinc

 

Edit: The serial monitor also can be found under the menu item "Tools" and than "Serial Monitor". That way an open window can be closed too.

 

yeh thats off. iv just tried it with a new cable and get the same error.
iv tried different usb ports. different cables and different arduinos!! 
how do i tell whats already on the arduino board?

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

Hi eatthis,

I understood that you have tried several USB ports, including new cables and different Arduino boards, to make a connection between the Arduino and the IDE. Neither of that worked for you. I assume that the connection is still greyed out if you try to connect via the “Tools/Port” menu items.

That seems to me like a problem that must be solved between the Arduino board and your installation of the IDE. It may help to delete the COM ports within Windows device manager or re-install the Arduino IDE. Nevertheless, I would trace your technical issue down to non-DcsBios related roots. Sorry to say, that I don’t have the qualification to help and bring up more detailed assistance.

 

Find out what’s already on an Arduino board is almost not possible. The upload process uploads a compiled binary file to the chip that cannot be “re-engineered” to human readable text. You have to remember what you have uploaded to a dedicated Arduino board. One exception is that you open the Serial Monitor after plug in the board and hope that the loaded sketch communicates via the serial interface.

 

 

To make it short: Your actual problem seems not related to the questioned sketch. You first have to solve the connection problems, related to the IDE or your computer COM ports.

 

 

Regards, Vinc


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

There is another possibility - if I try loading a sketch to an AT168P Nano using the 328 bootloader or the 328 (old bootloader)  in the 'tools' - 'processor' list, if I leave it long enough it will give that error. If the bootloader selected doesn't match it can't communicate with the nano

Cheers


Les

Link to comment
Share on other sites

  • Recently Browsing   0 members

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