Jump to content

DCS-BIOS Discussion Thread


FSFIan

Recommended Posts

visual programming

 

I'm working on visual programming for DCS-BIOS.

The idea is drag-and-drop programming negating the need for C++ programming skills. Thats the high-level goal.

 

I've made such tooling for arduino + javascript.

 

68747470733a2f2f692e696d6775722e636f6d2f305863774362642e706e67

 

See my website --> https://github.com/pappavis/EasyBlocks4Kids

try out here --> http://erasmus-ict.nl/easylab4kids

How it works --> https://www.facebook.com/EasyBlocks4Kids/

 

Installation instructions;

1. Downloads and install NodeJS.

2. do a "npm install johnny-five" in your home dir.

3. Write a program, see above screenshot.

4. Copy-paste the generated programcode into texteditor, and execute with node whatever.js

5. Order an EasyLab here --> https://goo.gl/hUQvhV

 

A trial DCS-BIOS implementation will come "soon".

 

all feedback, suggestions welcome.

#easylab4kids #easyblocks4kids


Edited by pappavis
  • Like 1

met vriendelijke groet,

Михель

 

"умный, спортсмен, комсомолетс"

 

[sIGPIC]159th_pappavis.jpg[/sIGPIC]

 

[TABLE]SPECS: i9-9900K 32gigs RAM, Geforce 2070RTX, Creative XFi Fata1ity, TIR5, Valve Index & HP Reverb, HOTAS Warthog, Logitech G933 Headset, 10Tb storage.[/TABLE]

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys, sorry to ask a couple of questions i could search for am sure I will get straighter answers just asking:

 

1. Does this run on a nano

2. I have a hud, it needs 7 pots for dim/volume, has 3 on-off-on, 3 on-off and 26 push buttons. Can this be done with one Nano (although I have 3 if reuired.

 

Thanks

Link to comment
Share on other sites

...

1. Does this run on a nano

2. I have a hud, it needs 7 pots for dim/volume, has 3 on-off-on, 3 on-off and 26 push buttons. Can this be done with one Nano?

...

Dear Mr_Burns (and others).

Maybe it helps a little: I opened a new Thread with a potential answer to your questions (there is also a link to the userguide available). :book:

https://forums.eagle.ru/showthread.php?p=3292776#post3292776

Please read there and answer (and maybe ask further) there. :) (NOT here) :music_whistling:

Thank you. :thumbup:


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

I have done that without any issues when flying the MIG-21 previously. Since then I have bought a new PC bu didn't install DCS-Bios yet since I only fly the Viggen for the moment, so can't tell if something has changed with the current versions.

Can't remeber exactly how the export script was configured, but I believe it was pretty simple to get it running properly.

Link to comment
Share on other sites

  • 4 weeks later...

On the right track, DCS-BIOS, Mi-8 and rewired ARC-9 Box?

 

Hi DCS-Bios Users,

 

Moved my post here....

My name is Molevitch and I fly helicopters in DCS, mostly Mi-8, sometimes Huey. I hope you can help me.

 

I fly in VR, Rift, but am building a pit in anticipation of the Mi-24 (fingers crossed) which I can use for Mi-8 also, as there is so much crossover on Russian equipment.

 

I have been building radio panels and so far I have created R-863, R828, SPU-7 and Jadro. These are all managed through a Bodnar 64 Button board, and all work perfectly.

 

Now, I bought a genuine ARC-9 Radio Nav box on eBay. I want to retain the main freq dials with their original mechanical switches, as they feel great, a fantastic clunky feedback. Other tuner pots have been replaced with rotary encoders, as has volume. Mode selector was busted, and has been replaced with a rotary switch.

 

So I have not used DCS-BIOS.... or Arduino.... yet.

 

In my research into this, I have discovered Mi-8 JSON files, and am just now reading and beginning to understand DCS-BIOS and Arduino Sketch.

 

My question, and hope for help. Will the Mi-8 JSON script enable the correct use of the original dial-switches?

 

I have now rewired the originals to create simple switches on the 100Khz and 10Khz dialers on the top wafers (not shown in pic). This creates 21 switches per dial set, 10 + 11, In DCS Mi-8 Controls options, only Increase or Decrease is offered. I want the dials to select the correct frequency when switched/turned.

 

Wiring has been terminated with female duponts for connection to Bodnar BBI 64. This can be changed to male pins for an Arduino board. I have ordered an Arduino board to use.

 

I am not asking you to do it all for me, of course! I just want to check I am on the right path before I invest hours of time on this....

 

Thank you for your consideration of my question. I hope you will give me a little guidance.

 

Yours,

 

Molevitch.

 

attachment.php?attachmentid=174195&d=1513150435

attachment.php?attachmentid=174194&d=1513150435

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

  • 3 weeks later...

Hi guys,

 

is it actually possible to invert a switch within DCS Bios or its Arduino programing?

 

For an example I've wired up the Aerial Refueling Slipway Control Lever switch as normally open.

Having it in normally open makes the lever move to closed in DCS instead of open, when activated.

 

Yes I know I could just reconnect the switch to be normally closed, but it don'T have enough space for that.

 

Thanks and cheers

 

Sven

Link to comment
Share on other sites

Hi guys,

 

is it actually possible to invert a switch within DCS Bios or its Arduino programing?

 

For an example I've wired up the Aerial Refueling Slipway Control Lever switch as normally open.

Having it in normally open makes the lever move to closed in DCS instead of open, when activated.

 

Yes I know I could just reconnect the switch to be normally closed, but it don'T have enough space for that.

 

Thanks and cheers

 

Sven

 

Thanks to a small hin from Hansolo the problem is solved.

I don't know if it is the correct way but it worked.

 

const byte fscpRcvrLeverPins[2] = {39,};
DcsBios::SwitchMultiPos fscpRcvrLever("FSCP_RCVR_LEVER", fscpRcvrLeverPins, 2);

Link to comment
Share on other sites

  • 4 weeks later...

I did some experimenting with DCS-BIOS, Arduino UNO, Adafruit Motor Shield V2 and 2Deg bipolar stepper motors. Here is my example code. This code reads the A-10C VVI value and moves the stepper motor according to the value. I used code from this thread as a baseline: https://forums.eagle.ru/showpost.php?p=3188826&postcount=3

 

//----------------------------------------------------
//****DCS-BIOS ADAFRUIT MOTOR SHIELD V2 EXAMPLE CODE****
// This example is for Adafruit Motorshield v2 only!
// Will not work with v1 shields
//----------------------------------------------------

#define DCSBIOS_IRQ_SERIAL

#include <Wire.h>
#include <AccelStepper.h>
#include <Adafruit_MotorShield.h>
#include "DcsBios.h"

//*****ADAFRUIT MOTOR SHIELD V2 SPECIFIC SETTINGS*****
//----------------------------------------------------
Adafruit_MotorShield AFMStop(0x60); // Only one Adafruit Motor Shield in use. Default address, no jumpers.

// Stepper with 180 steps per revolution (2.0 degree) connected to position 2 (M3 and M4) on the board
// Only one shield is in use so it is named as AFMStop. If you have another you can name it AFMSbot, AFMSmed etc
Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(180, 2);

// Wrappers for the motor!
// You can change steps to DOUBLE, INTERLEAVE or MICROSTEP
void forwardstep2() {  
 myStepper2->onestep(FORWARD, DOUBLE);
}
void backwardstep2() {  
 myStepper2->onestep(BACKWARD, DOUBLE);
}

//----------------------------------------------------
//*****ADAFRUIT MOTOR SHIELD V2 SPECIFIC SETTINGS END HERE*****


//This example code is from Eagle Dynamics Forums. I do not know the author. I modified it a little.

struct StepperConfig {
 unsigned int maxSteps;
 unsigned int acceleration;
 unsigned int maxSpeed;
};

class AdafruitStepper : public DcsBios::Int16Buffer {
 private:
   AccelStepper& stepper;
   StepperConfig& stepperConfig;
   unsigned int (*map_function)(unsigned int);
   unsigned char initState;
 public:
   AdafruitStepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned int (*map_function)(unsigned int))
   : Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), map_function(map_function), initState(0) {
   }

   virtual void loop() {
     if (initState == 0) { // not initialized yet
       stepper.setMaxSpeed(stepperConfig.maxSpeed);
       stepper.setAcceleration(stepperConfig.acceleration);
       stepper.moveTo(-((long)stepperConfig.maxSteps));
       initState = 1;
     }
     if (initState == 1) { // zeroing
       stepper.run();
       if (stepper.currentPosition() <= -((long)stepperConfig.maxSteps)) {
         stepper.setCurrentPosition(0);
         initState = 2;
         stepper.moveTo(stepperConfig.maxSteps/2);
       }
     }
     if (initState == 2) { // running normally
       if (hasUpdatedData()) {
         unsigned int newPosition = map_function(getData());
         newPosition = constrain(newPosition, 0, stepperConfig.maxSteps);
         stepper.moveTo(newPosition);
       }
       stepper.run();
     }
   }
};

/* Define stepper parameters
  multiple AdafruitStepper instances can share the same StepperConfig object */
struct StepperConfig stepperConfig = {
 180,  // maxSteps
 1200, // maxSpeed
 10000 // acceleration
 };

// define AccelStepper instance
AccelStepper stepper(forwardstep2, backwardstep2);
// define AdafruitStepper class that uses the AccelStepper instance defined in the line above
//               +-- arbitrary name (A-10C vertical velocity indicator in this example)
//               |   +-- Address of stepper data (from control reference)
//               |   |       +-- name of AccelStepper instance
//               v   v       v        v-- StepperConfig struct instance
AdafruitStepper vvi(0x106e, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int {
 /* this function needs to map newValue to the correct number of steps */
 return map(newValue, 0, 65535, 0, stepperConfig.maxSteps);
}); 


void setup() {
 DcsBios::setup();
 AFMStop.begin(); // Start the top Adafruit motor shield. 
}

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


Edited by Chain

System:

Windows 10 | i7-7700K @ 4.5 Ghz | 32GB of RAM | Nvidia GTX 1080, 3440x1440 | DELL Ultrawide U3415W | Samsung 960 Evo M.2 and 2 TB Seagate Barracuda | TM Warthog Hotas | SLAW F-16 Pedals | Oculus Rift CV1 and HTC Vive PRO VR

 

+ High fidelity F/A-18C simpit :)

Link to comment
Share on other sites

In the past i got basic dcsbios working for switches for push buttons, toggles, rotary switches and encoders. then when i tried to get rs485 working via Hansolo's method of max487, that is a new level of difficulty. I consulted him many times with questions on wiring, compiling errors. He was very helpful and patient. Thanks Hans!

 

I even got the master mega to compile, and separately the slave nano to compile. Then when linked up and they lit up and started the master com port, then nothing happens except the annoying couldn't compute fast_cwd pointer error.

 

after several tries, checking wiring and sketches etc. i deleted the dcsbios folder. tried to reinstall and it can't even find the dcsbios.h file.

 

many of you have done this dcsbios install, and some even tried the rs485 successfully. instead of keep on bothering Hansolo and Ian, can you guys share how should dcsbios be properly installed? and after that the sequence of running the rs485?

 

At github we have the v.0.7.1 for download. it will download dcs-bios-v.0.7.1.zip. to install a library one clicks on the zip file. but when i do that, the library name becomes dcs-bios-v.0.7.1 in the IDE, does that matter? must it be just dcsbios?

 

then at the download page, there's the second link for the source code. that will download dcs-bios-0.7.1.zip with the 'v'. the folders inside look identical to the dcs-bios-v.0.7.1.zip file's. do i have to bother with this second zip file?

 

then there's the tar.gz. do i have to bother with that?

 

and i read something about socat. i tried to run it and it extracted a folder. i ran socat.exe and nothing happened.

 

can i know which files above i need to bother with?

do i need to rename the zip file? or the folder inside? they all contain the version number.

 

and after i get dcsbios properly installed, no more errors, and it can find dcsbios.h etc. how to best run the rs485? if both master and slave can compile when connected to usb, i disconnect slave's usb, link up the maxchip, then just run com port cmd for master, and push some switch on the slave and i should see stuff running on the cmd prompt like when the arduino is a standalone board?

 

can warning errors like the can't compute be ignored or must be fixed?

sorry many questions. but if i figure this out i hope it'd help others going to attempt rs485 too.

Link to comment
Share on other sites

This code is work:

 

#define DCSBIOS_IRQ_SERIAL

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "DcsBios.h"

#define digits_00_32x64_width 32
#define digits_00_32x64_height 64
const PROGMEM unsigned char digits_00_32x64_bits[] = {
// cut
};

#define digits_1to9_32x64_width 32
#define digits_1to9_32x64_height 704
const PROGMEM unsigned char digits_1to9_32x64_bits[] = {
//cut
};
#define digits_32x64_width 32
#define digits_32x64_height 704
const PROGMEM unsigned char digits_32x64_bits[] = {
// cut
};

DcsBios::ProtocolParser parser;
Adafruit_SSD1306 display(4);

void onAlt10000ftCntChange(unsigned int newValue) {
   drawDigit(0, newValue, digits_1to9_32x64_bits);
}
void onAlt1000ftCntChange(unsigned int newValue) {
   drawDigit(1, newValue, digits_32x64_bits);
}
void onAlt100ftCntChange(unsigned int newValue) {
   drawDigit(2, newValue, digits_32x64_bits);
}

DcsBios::IntegerBuffer alt10000ftCntBuffer(0x1080, 0xffff, 0, onAlt10000ftCntChange);
DcsBios::IntegerBuffer alt1000ftCntBuffer(0x1082, 0xffff, 0, onAlt1000ftCntChange);
DcsBios::IntegerBuffer alt100ftCntBuffer(0x1084, 0xffff, 0, onAlt100ftCntChange);



void drawDigit(unsigned int index, unsigned int offset, unsigned char* bits) {
 unsigned int y_offset_lines = offset / 103;
  display.fillRect(32*index, 0, 32, 64, BLACK);
  display.drawXBitmap(32*index, 0, &bits[4*y_offset_lines], 32, 64, WHITE);
  display.display();   
}

void setup() {
 DcsBios::setup();
 display.begin(SSD1306_SWITCHCAPVCC);
 display.clearDisplay();
 drawDigit(0, 0, digits_1to9_32x64_bits);
 drawDigit(1, 0, digits_32x64_bits);
 drawDigit(2, 0, digits_32x64_bits);
 drawDigit(3, 0, digits_00_32x64_bits);
}

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

 

But why not work this code? Not run method onDcsBiosWrite. I use last version of DCS-BIOS

 

#define DCSBIOS_IRQ_SERIAL

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "DcsBios.h"

#define digits_00_32x64_width 32
#define digits_00_32x64_height 64
const PROGMEM unsigned char digits_00_32x64_bits[] = {
// cut
};

#define digits_1to9_32x64_width 32
#define digits_1to9_32x64_height 704
const PROGMEM unsigned char digits_1to9_32x64_bits[] = {
//cut
};
#define digits_32x64_width 32
#define digits_32x64_height 704
const PROGMEM unsigned char digits_32x64_bits[] = {
// cut
};

DcsBios::ProtocolParser parser;
Adafruit_SSD1306 display(4);

void drawDigit(unsigned int index, unsigned int offset, unsigned char* bits) {
 //double y_offset = (double)offset / 65535.0d;
 //unsigned int y_offset_lines = y_offset * 640;
 unsigned int y_offset_lines = offset / 103;
  display.fillRect(32*index, 0, 32, 64, BLACK);
  display.drawXBitmap(32*index, 0, &bits[4*y_offset_lines], 32, 64, WHITE);
  display.display();   
}

void onDcsBiosWrite(unsigned int address, unsigned int value) {
 address = address & 0xffff;
 value = value & 0xffff;
 if (address == 0x1080) {
   unsigned int alt10000ftCntValue = (value & 0xffff) >> 0;
   drawDigit(0, alt10000ftCntValue, digits_1to9_32x64_bits);
 }
 
 if (address == 0x1082) {
   unsigned int alt1000ftCntValue = (value & 0xffff) >> 0;
   drawDigit(1, alt1000ftCntValue, digits_32x64_bits);
 }
 
 if (address == 0x1084) {
   unsigned int alt100ftCntValue = (value & 0xffff) >> 0;
   drawDigit(2, alt100ftCntValue, digits_32x64_bits);
 }
}

void setup() {
 DcsBios::setup();
 display.begin(SSD1306_SWITCHCAPVCC);
 display.clearDisplay();
 drawDigit(0, 0, digits_1to9_32x64_bits);
 drawDigit(1, 0, digits_32x64_bits);
 drawDigit(2, 0, digits_32x64_bits);
 drawDigit(3, 0, digits_00_32x64_bits);
}

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

My cockpit A-10C

Строю кокпит A-10C

i7 7700k, 32Gb RAM, SSD NVMe, GTX 1080, Hotas Warthog, HTC Vive.

-----------------

With love from Russia

Link to comment
Share on other sites

Alburg, maybe mega to mega is impossible or at least difficult. why don't you try mega to nano first? hansolo has many panels set up that way. if you can at least make it work for mega to nano, that can be your backup set up.

 

i know some panels need many input or output. my plan is to use 2 nanos when needed instead of a mega slave. nanos are much cheaper anyway.

Link to comment
Share on other sites

TCP commands

 

Using zerobrane to open tcp connection to send commands to pull t handles. I can see a tcp socket open through netstat but no joy on dcs getting the commands any hints?

 

while true do
       local server = assert(s.bind("127.0.0.1",7778))  
       print("waiting for connection on port 7778  ")
       local client = server:accept()
       print("connected")
       client:send("FIRE_EXT_DISCH INC \n")
       client:send("FIRE_EXT_DISCH DEC \n")
      -- sleep(10)
       client:send("FIRE_LENG_PULL INC\n")
       client:send("FIRE_LENG_PULL DEC\n")
       client:settimeout(10)
       
     end
     

Link to comment
Share on other sites

  • 4 weeks later...

just a quick question from a newbie. i have the m2000c library and im working with the rpm gauge needle

 

DcsBios::ServoOutput nRpm(0x6058, 9, 544, 2400);

 

i can control a servo just fine but id like to control a small dc motor from a playstation controller in my joystick to add slight vibration. when i connect the motor to gnd and pin 9 it whines as its not being supplied enough voltage? i have some L298N h bridges and if i understand correctly i should be able to use them to control the motors speed with pulse width modulation. this is where im lost. ive been watching tutorials on how to do it standalone but linking it to dcs bios has got me stuck. could anyone point me in the right direction. again im very new to this and basicly just winging it :P

Link to comment
Share on other sites

  • 4 weeks later...
  • Recently Browsing   0 members

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