Jump to content

DCS-BIOS Discussion Thread


FSFIan

Recommended Posts

Hi! Is there any way to export the Huey Clock to a digital format? To use an LCD

 

Yes.

 

I did it 11 days ago.

Seconds act a bit wierd after a cycle.

 

There is more stuff in the code but you will find the clock in there.

I can clean the code after work if you like. Just let me know.

 

 

// ------------------------------------------------------------------

// HUEY

// ------------------------------------------------------------------

// Yngwie84 15 MARCH 2019

// Hardware:

// Arduino Mega 2560.

// ROTARY ENCODER 20P WITH SWITCH

// 10KOHM POTENTIOMETER

// ------------------------------------------------------------------

// DCS BIOS DCS BIOS DCS BIOS DCS BIOS

// ------------------------------------------------------------------

#define DCSBIOS_IRQ_SERIAL

#include "DcsBios.h"

#include <LiquidCrystal.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

// ------------------------------------------------------------------

// ROTARY ENCODERS ROTARY ENCODERS ROTARY ENCODERS

// ------------------------------------------------------------------

// ENCODER 1 = PINA/B 45, 21);

// ENCODER 2 = PINA/B 43, 20);

// ENCODER 3 = PINA/B 41, 19);

// ENCODER 4 = PINA/B 39, 18);

// ------------------------------------------------------------------

// PUSH BUTTONS PUSH BUTTONS PUSH BUTTONS

// ------------------------------------------------------------------

// ENCODER BUTTON 1 = PIN 53

// ENCODER BUTTON 2 = PIN 51

// ENCODER BUTTON 3 = PIN 49

// ENCODER BUTTON 4 = PIN 47

// JOYSTICK BUTTON 1 = PIN 2

// ------------------------------------------------------------------

// POTENTIOMETER POTENTIOMETER POTENTIOMETER

// ------------------------------------------------------------------

// POT 1 = PIN A3

// POT 2 = PIN A2

// POT 3 = PIN A1

// POT 4 = PIN A0

// SLIDER 1 = PIN A5???

// JOYSTICK X = PIN A8

// JOYSTICK Y = PIN A9

// ------------------------------------------------------------------

// LCD DISPLAY LCD DISPLAY LCD DISPLAY

// ------------------------------------------------------------------

void onUhfFreqChange(char* UHFValue) {

lcd.setCursor(5, 0);

lcd.print(UHFValue);

}

DcsBios::StringBuffer<6> uhfFreqBuffer(0x14e0, onUhfFreqChange);

 

void onVhfcommFreqChange(char* VHFValue) {

lcd.setCursor(5, 1);

lcd.print(VHFValue);

}

DcsBios::StringBuffer<7> vhfcommFreqBuffer(0x14d2, onVhfcommFreqChange);

 

void onVhfnavFreqChange(char* VHFNavValue) {

lcd.setCursor(5, 2);

lcd.print(VHFNavValue);

}

DcsBios::StringBuffer<6> vhfnavFreqBuffer(0x14ee, onVhfnavFreqChange);

 

void onRaltDisplayChange(unsigned int Radar) {

int val1= map(Radar,0,65000,0,65000); // max radar range.

lcd.setCursor(5, 3);

lcd.print(val1);

}

DcsBios::IntegerBuffer raltDisplayBuffer(0x14aa, 0xffff, 0, onRaltDisplayChange);

 

void onClockHChange(unsigned int Timmar) {

int val2= map(Timmar,0,65535,0,12); // max radar range.

lcd.setCursor(12, 3);

lcd.print(val2);

}

DcsBios::IntegerBuffer clockHBuffer(0x1478, 0xffff, 0, onClockHChange);

 

void onClockMChange(unsigned int Minuter) {

int val3= map(Minuter,0,65535,0,59); // max radar range.

lcd.setCursor(15, 3);

lcd.print(val3);

}

DcsBios::IntegerBuffer clockMBuffer(0x147a, 0xffff, 0, onClockMChange);

 

void onClockSChange(unsigned int Sekunder) {

int val4= map(Sekunder,0,65535,0,59); // max radar range.

lcd.setCursor(18, 3);

lcd.print(val4);

}

DcsBios::IntegerBuffer clockSBuffer(0x147c, 0xffff, 0, onClockSChange);

 

// ------------------------------------------------------------------

// SETUP SETUP SETUP SETUP SETUP

// ------------------------------------------------------------------

 

void setup() {

DcsBios::setup();

// set up the LCD's number of columns and rows:

lcd.begin(20, 4);

// Print a message to the LCD.

lcd.print("VHF:");

lcd.setCursor(0, 1);

lcd.print("UHF:");

lcd.setCursor(0, 2);

lcd.print("NAV:");

lcd.setCursor(0, 3);

lcd.print("ALT:");

lcd.setCursor(14, 3);

lcd.print(":");

lcd.setCursor(17, 3);

lcd.print(":");

}

 

void loop() {

DcsBios::loop();

}

 

Yngwie84: ingame & on Twitch

X55-Hotas - Logitech rudder pedals - DCS Bios box.

Link to comment
Share on other sites

  • 1 month later...

Hi all !

 

I need some help ! I'm juste trying to make a test circuit and nothing works !

 

LgIHUPi.jpg

 

/*

Tell DCS-BIOS this is a RS-485 Master.

You will need to flash this to a Mega 2560.

*/

#define DCSBIOS_RS485_MASTER

 

/*

Define where the TX_ENABLE signals are connected.

You can connect up to three half-duplex RS-485 transceivers.

 

Arduino Pin RS-485 Transceiver Pin

TXn ------------------- DI (driver input)

RXn ------------------- RO (Receiver Output)

UARTn_TXENABLE_PIN ---- /RE, DE (active low receiver enable, driver enable)

 

If you have less than three transceivers connected, comment out the corresponding

#define UARTn_TEXENABLE_PIN lines for receivers that are not present.

*/

#define UART1_TXENABLE_PIN 2

/*#define UART2_TXENABLE_PIN 3*/

/*#define UART3_TXENABLE_PIN 4*/

 

#include "DcsBios.h"

 

void setup() {

DcsBios::setup();

}

 

void loop() {

DcsBios::loop();

}

 

/*

The following #define tells DCS-BIOS that this is a RS-485 slave device.

It also sets the address of this slave device. The slave address should be

between 1 and 126 and must be unique among all devices on the same bus.

*/

#define DCSBIOS_RS485_SLAVE 1

 

/*

The Arduino pin that is connected to the

/RE and DE pins on the RS-485 transceiver.

*/

#define TXENABLE_PIN 2

 

#include "DcsBios.h"

 

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

DcsBios::Switch2Pos masterArmSw("MASTER_ARM_SW", 5);

 

//Master Caution Light

DcsBios::LED masterCautionLt(0x1012, 0x0800, 13);

 

void setup() {

DcsBios::setup();

}

 

void loop() {

DcsBios::loop();

}

 

The Tx on the master and the rx on the slave are on...

Alienware Aurora R8 I7 9700K WC, GeForce 1080 Ti 11Gig, Occulus Rift

Link to comment
Share on other sites

Have you insert the resistors between the outputs of the $S 485 drivers?

Like in the datasheet.

 

No, I didn't put the resistance but others said that they are not mandatory...

Alienware Aurora R8 I7 9700K WC, GeForce 1080 Ti 11Gig, Occulus Rift

Link to comment
Share on other sites

Hi all !

 

...

I'm juste trying to make a test circuit and nothing works !

...

What do you expect your Fritzing-Sketch should do?

 

First: Double(!!!)check (double means: do it minimum twice) if your real wireing is matching your sketch? Drawing a line on a paper is very different to running a wire on a desk!

Second: Add some actors and actuators to your "situation". In your sketch I can't detect anything what can do a thing. There's neither a switch nor a LED to be seen. (OK. Inbuilt LEDs on MEGA and NANO will be lit or will flash.)

Third: (or maybe the most important thing) Is your DCS-BIOS installed proper and is THIS doing anything?

 

And Last (this should also be at the begin of "my" list: Have you gone through the whole procedure? Mean: Have you read the manual?

 

I know about the very first (and maybe painful) steps in creating something that will work as intended. So: Work my (it's not really mine) list. You are very close to a success.

 

Hint: I burned some of 10 Max487s before I got a satisfying result. So add to the list: Check hardware if working properly from time to time!!!!

 

@Roni86: I think you mean Terminators? You won't need those for that simple test installation.

 

Blue Skies and Happy Landings!

Manual for my version of RS485-Hardware, contact: tekkx@dresi.de

Please do not PM me with DCS-BIOS-related questions. If the answer might also be useful to someone else, it belongs in a public thread where it can be discovered by everyone using the search function. Thank You.

Link to comment
Share on other sites

Hi Tekkx,

 

in my installation i need one resistor (121 Ohm as Terminator) at the master. Otherwise it wouldn't work.

 

Open lines are not good, if the wires are long. If the termination is missing some crazy things can happen.

 

Greetings

Roni

Link to comment
Share on other sites

What do you expect your Fritzing-Sketch should do?

 

First: Double(!!!)check (double means: do it minimum twice) if your real wireing is matching your sketch? Drawing a line on a paper is very different to running a wire on a desk!

Second: Add some actors and actuators to your "situation". In your sketch I can't detect anything what can do a thing. There's neither a switch nor a LED to be seen. (OK. Inbuilt LEDs on MEGA and NANO will be lit or will flash.)

Third: (or maybe the most important thing) Is your DCS-BIOS installed proper and is THIS doing anything?

 

And Last (this should also be at the begin of "my" list: Have you gone through the whole procedure? Mean: Have you read the manual?

 

I know about the very first (and maybe painful) steps in creating something that will work as intended. So: Work my (it's not really mine) list. You are very close to a success.

 

Hint: I burned some of 10 Max487s before I got a satisfying result. So add to the list: Check hardware if working properly from time to time!!!!

 

@Roni86: I think you mean Terminators? You won't need those for that simple test installation.

 

Blue Skies and Happy Landings!

 

Hi Tekkx,

 

It's not show on the drawning but I try with a 2 pos switch on the slave. Every thing work fine when I start DCS Bios with the IRQ serial sketch and a mega. The problem is when I try to comunicate the information with the RS-485 method.... I have 4 max 487... maybe they are all frieds... How do we know when they are fried ?

Alienware Aurora R8 I7 9700K WC, GeForce 1080 Ti 11Gig, Occulus Rift

Link to comment
Share on other sites

Bad news: There is no easy way to check your transceivers. I tried it myself by checking the different voltages on the lines, checking current on the supply, I even did it with some kind of oscilloscope. To interprete these values is some kind of middle to high level science. ;)

 

The only way (thanks to chinese copywork this way is also affordable): Kicking off suspect chips and replace them by a new one out of the box.

I use SMT SO packages. As they have a pin of 1.27 mm this is some special experience. Warhog (You'll know him. He's also Canadian. Just kidding! But he is also a member of this forum so you'll know him.) instead bets on the DIL-package with plug-in sockets. So he uses just the pull-throw-and-stick method. (In military chargon it is called PUTAS!)

 

I dont know how much chips I've burnt before I got an result. I think, I started the same way as you right now. Then I went the second step and started to develop a bullet- and fool-safe thing (as you can look at if you follow the link in my signature).

 

Another way you have to check: Is your MEGA working proper? I observed sometimes a strange behavior of these MEGAs (may be in corelation with my very old PC): Suddenly a MEGA does not work. So I replaced it by another, brandnew one (you have to know, I have plenty of these here in a box). Few days or weeks later I gave the first, suspect failing one, a second chance: now it does the job as it has never failed before. Miracle!

 

AND: It's like a prayer: Check your lines, check your lines, check your lines..... (and never stop that).

 

Termination you'll just need if your overall line length exceeds about 10 m (or 30 feet). So if there is a list of suspects: Termination is the very last item on that list.

 

Good luck.

 

PS (edit 4 or 5): I read your last post again: Maybe it sounds stupid: Do you aware that you have to modify your Slave-script if you change from common serial communication to RS-485?

IMG_20161214_184746.thumb.jpg.e98892475da61f157ec139ead5425b0b.jpg


Edited by Tekkx

Manual for my version of RS485-Hardware, contact: tekkx@dresi.de

Please do not PM me with DCS-BIOS-related questions. If the answer might also be useful to someone else, it belongs in a public thread where it can be discovered by everyone using the search function. Thank You.

Link to comment
Share on other sites

Thanks Tekkx for your support and for all the information ! I will try and try again ! For now i'm just trying to make the communication work.

 

there is my code for my basic test for the slave, it's the basic sketch in dcs-bios arduino librairie

 

/*

The following #define tells DCS-BIOS that this is a RS-485 slave device.

It also sets the address of this slave device. The slave address should be

between 1 and 126 and must be unique among all devices on the same bus.

*/

#define DCSBIOS_RS485_SLAVE 1

 

/*

The Arduino pin that is connected to the

/RE and DE pins on the RS-485 transceiver.

*/

#define TXENABLE_PIN 2

 

#include "DcsBios.h"

 

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

DcsBios::Switch2Pos masterArmSw("MASTER_ARM_SW", 5);

 

//Master Caution Light

DcsBios::LED masterCautionLt(0x1012, 0x0800, 13);

 

void setup() {

DcsBios::setup();

}

 

void loop() {

DcsBios::loop();

}

Alienware Aurora R8 I7 9700K WC, GeForce 1080 Ti 11Gig, Occulus Rift

Link to comment
Share on other sites

Gents, I have DCS World with just the basic Su-25 and P-51. I also have the original DCS A-10C Warthog, and what I want to do is use the DCS BIOS with that to make control and instrument panels. I see that DCS BIOS supports an A-10C but I don't know if they mean the one you have to buy as a separate module in DCS world, or whether they mean the A-10C Warthog version.

 

I have tried following the instructions to see if I can get it to work with A-10C Warthog, but so far it has not worked, but of course I can't be sure whether its my fault or that it is incompatible

 

Can anyone clarify this?

 

Thanks

 

Les

Link to comment
Share on other sites

It's very close to the edge of topic, but:

Everything mentioned about DCS-BIOS and A-10C is related to the DCS-World-Module A-10C. If it works (or not) with the stand alone version... I don't know.

Otherwise (if I remember right) you should be able to import your License to the "World". Think I did so about 4 or 5 years ago. Just take care for "steam" or "not steam".

 

You'll find thousends posts relating license matters herin the forum at other places.

Manual for my version of RS485-Hardware, contact: tekkx@dresi.de

Please do not PM me with DCS-BIOS-related questions. If the answer might also be useful to someone else, it belongs in a public thread where it can be discovered by everyone using the search function. Thank You.

Link to comment
Share on other sites

A-10C is A-10C or not? should work with it.

also steam makes no difference for BIOS. (im a steam user)

 

to verify it you can open the refpage an check the name for it.

for refpage you need an installed DCSBIOS (see sig)

 

To get the Plane Name, open the control-reference page while you fly that plane. In MetadataStat you find the Plane Name.

 

For setting up the Control-reference Page:

Install Google Chrome

Chrome → "Settings" → "More Tools" → "Extensions", check "Developer mode"

Click "Load unpacked extension…​" and choose your "C:\Users\<username>\Saved Games\DCS\Scripts\DCS-BIOS\doc" folder

A new extension "DCS-BIOS Control Reference Live Preview" will be visible under "Apps".

Exit "Settings"

Start DCS, load a Mission and jump in a Plane

Click "Apps" in your Browser. Your DCS-BIOS extension be there. From there you can see the controls change as you fly and manipulate the cockpit.

 

if its A-10C it work

if not write me. i show what i can do

Link to comment
Share on other sites

Thanks for the answers guys.

 

I tried the live preview thing, once DSC World starts there is no way to make chrome visible again. However I can see that in the command prompt box that is opened when you run the DCS Bios I can see that it is outputting data to the CMD prompt, and it looks like it is talking to the Arduino as when DCS is running there is a light continually flashing on it. However, the test button switch I connected between pin 10 and the GND pin does nothing despite me copying verbatim the BIOS code and replacing 'PIN' with 10.

 

I'v tried to keep it simple, testing using the TF51 and selecting the landing gear toggle, no luck, then trying with the unsafe landing gear light test switch again to no avail.

 

As for using my A-10C DVD license key for DCS world, it looks like there is no way to download the module without paying for it first. My DCS world is the steam edition, not sure if that makes a difference

 

Definitely stuck here and can't for the life of me see why it's not working

 

Cheers

 

Les

Link to comment
Share on other sites

As the non-steam version is the same as the steam version, I am trying to load up the non-steam version and see if I can link the DCS A-10C Warthog license to it - I have nothing to lose!

 

As for the Chrome, I played around and finally got it to come to the top, but couldn't find the 'apps' you discussed, can you point me to it?

 

Thanks again for all your help!

 

Les

Link to comment
Share on other sites

Guys, double success - DCS world standalone accepts the DCS A-10C Warthog key, all good, plus the standalone DCS world works with the DCS BIOS. I was certain I set it up right, and am relieved that it is all good.

 

Now I have to make it all work properly and make the right panels!

 

Thanks again for all the help!

 

Cheers


Edited by lesthegrngo
Link to comment
Share on other sites

In my case, I didn't put a resistor in for testing two out of the three. As the examples that came with the Arduino set didn't use resistors I guessed that temporarily at least none were needed.

 

As it happens as a lot of my LED's come from old Christmas lights, and so the remaining one does have a resistor already soldered on to it presumably to allow it to be used with a particular voltage. It is under some shrink wrap, I will get a spare one an identify it for you. It was less bright than the other two, but not by a lot

 

**EDIT** it is a 2K resistor

 

Cheers

 

Les


Edited by lesthegrngo
Link to comment
Share on other sites

  • 4 weeks later...

RS485 Circuit: DCS-BIOS Master Slave driving me mad

 

Hi Guys, especially HanSolo and Craig S,

 

I have been following carefully your RS485 setup, as you may recall.

 

I have had successful sketches running on two panels in stand alone serial modes. They work.

 

I have converted the sketches to slaves. I have set up a Mega as Master. I have uploaded the first slave sketch to a Nano. I have soldered and wired some veroboard and mounted a socket for the Max487 chip. I have tested all with a meter.

 

I am now several 10s of hours into failing to find out why it is not working!!! On the mega, the TX Led is flashing away, but not the RX. On the Nano there are 3 LEDs lit, RX, TX, and POL1.

 

The Master sketch is running all good, black and white text scrolling like mad.

 

I figure the RX LED on the Mega should be flashing too, to show it is receiving.... I have swapped in new Max487s. No change.

 

Help!

 

Mole

SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2

Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit.

 

[sIGPIC][/sIGPIC] www.blacksharkden.com

bsd sig 2021.jpg

Link to comment
Share on other sites

Hi Mole

 

Could you attach a few pictures showing your setup. Also can you try and load a master caution sketch to pin 13 on your Nano? I use this as my communication check. If I can get Led pin 13 blinking to something happening in game all is good.

 

I don't think the RX on Mega Master would blink until it recieves data from the Nano. I can check later

 

Cheers

Hans

Link to comment
Share on other sites

Hi Hans, re RS485 from Mole

 

Hi Hans,

 

Thanks for the speedy reply!

 

Some pics: See below.

 

I have tried a toggle switch on pin 13 (and 12). But nothing.... (Used the Mi-8 strobe light switch for that instead of A10 Master Caution). This is on the basic Nano. Slave 3

 

The other is Slave 1 with the radio selector panel. This panel works perfectly as a serial solo on USB.

 

I expect the RX on the Mega to blink only when receiving data, that makes sense. But I cannot tell if the Nano(s) are receiving either, since nothing appears to be happening.

 

I am pretty sure it is my wiring, but I have checked it all so many times, resoldered it, etc. The Nanos are receiving power.... Pics taken whikle not running DCS-Bios.

 

Mole

IMG_8889.thumb.JPG.73679373f1deeb99bbfd68ebe275d0de.JPG

IMG_8890.thumb.JPG.976c623683386142da37f1ae3bb1dec8.JPG

IMG_8891.thumb.JPG.634ffe9a6d941964da8b08fd1dafa532.JPG

IMG_8892.thumb.JPG.c7b16911b99ed94061c671bdb385fd8e.JPG

IMG_8893.thumb.JPG.5daed99ae156fa03f5049c9df5c22135.JPG

IMG_8894.thumb.JPG.f9becc13f088564bc53113ef603ce4e8.JPG


Edited by molevitch

SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2

Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit.

 

[sIGPIC][/sIGPIC] www.blacksharkden.com

bsd sig 2021.jpg

Link to comment
Share on other sites

  • Recently Browsing   0 members

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