Jump to content

DCS-BIOS Discussion Thread


FSFIan

Recommended Posts

Hi! Really really great job with DCS bios. Two questions, and I apologize if these have been answered before.

 

1. Do you plan to include the Viggen by LNS into DCS-bios when it has been released?

 

2. Would it be possible to export the numbers displayed by the RSBN selector in the Mig 21 to a LCD display? I would like to build a panel that includes the RSBN selection.

 

Once again. Great work!

Link to comment
Share on other sites

1. I don't plan to add any more aircraft myself. Adding an aircraft module requires you to be familiar with the aircraft to be able to verify that the definitions actually work. Familiarity with the aircraft also makes it easier to make sense of the clickabledata.lua file.

 

I do plan to make it easier to add new aircraft in DCS-BIOS 2.0.

 

 

2. I don't know, as I am not familiar with the Mig-21 and what is and is not exported (Mig-21 support was contributed by wraith444, I only did the A-10C and the UH-1H). Have a look through the control reference docs yourself and see if the values you need are available.


Edited by [FSF]Ian
Link to comment
Share on other sites

Ian;2796960']1. I don't plan to add any more aircraft myself. Adding an aircraft module requires you to be familiar with the aircraft to be able to verify that the definitions actually work. Familiarity with the aircraft also makes it easier to make sense of the clickabledata.lua file.

 

I do plan to make it easier to add new aircraft in DCS-BIOS 2.0.

 

 

2. I don't know, as I am not familiar with the Mig-21 and what is and is not exported (Mig-21 support was contributed by wraith444, I only did the A-10C and the UH-1H). Have a look through the control reference docs yourself and see if the values you need are available.

 

Thank you for your answer. In the control reference the code for setting up potentiometers for setting the RSBN channel is available, however the code for exporting what the RSBN channel displays is not. Perhaps this data is not even exported? I truly don't know. It would be very cool to add that to my simpit, and I thought it worthwile asking about it.

 

Once again, thank you so much for your work, and the work of the people collaborating with you. I hope to see more planes added in the future. The Viggen in particular. :)

Link to comment
Share on other sites

Both the RSBN and PRGM channel selectors are rotary encoders.

 

RSBN ChannelMiG-21Bis/RSBN_CHAN

Input Interface: fixed_step Message: RSBN_CHAN <DEC|INC> Description: switch to previous or next stateDcsBios::RotaryEncoder rsbnChan("RSBN_CHAN", "DEC", "INC", PIN_A, PIN_B);

Input Interface: set_state Message: RSBN_CHAN <new_value> Value Range: 0 ... 99 Description: set position

 

Output Type: integer Address: 0x2218 Mask: 0x3f80 Shift By: 7 Max. Value: 99 Description: selector positionif (address == 0x2218) {

unsigned int rsbnChanValue = (value & 0x3f80) >> 7;

/* your code here */

}

 

 

By the way, we are a lot of Swedes here that has great interest and a lot of knowledge about the Viggen. So I'm sure that the community will assist putting a DCS-Bios profile together and have the functionality verified :)

Link to comment
Share on other sites

Both the RSBN and PRGM channel selectors are rotary encoders.

 

RSBN ChannelMiG-21Bis/RSBN_CHAN

Input Interface: fixed_step Message: RSBN_CHAN <DEC|INC> Description: switch to previous or next stateDcsBios::RotaryEncoder rsbnChan("RSBN_CHAN", "DEC", "INC", PIN_A, PIN_B);

Input Interface: set_state Message: RSBN_CHAN <new_value> Value Range: 0 ... 99 Description: set position

 

Output Type: integer Address: 0x2218 Mask: 0x3f80 Shift By: 7 Max. Value: 99 Description: selector positionif (address == 0x2218) {

unsigned int rsbnChanValue = (value & 0x3f80) >> 7;

/* your code here */

}

 

 

By the way, we are a lot of Swedes here that has great interest and a lot of knowledge about the Viggen. So I'm sure that the community will assist putting a DCS-Bios profile together and have the functionality verified :)

 

Cool! Thanks! I'm extremely green when it comes to arduino coding, but perhaps I'll be able to whip up a prototype showing what I want then? Am I interpreting the code you posted correctly?

 

I'll give it a spin, and if it doesn't work I suppose I'll shout for help. :)

Link to comment
Share on other sites

Make sure you use the latest version of DCS-BIOS and the Arduino Library (the info in BravoYankee's post has been copied out of an older version of the reference docs). Then you can use an IntegerBuffer like this:

#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"

void onRsbnChanChange(unsigned int newValue) {
   // newValue is now the position of the RSBN channel selector
   // between 0 and 99. You may have to add one if the display
   // goes from 1 to 100, I am not familiar with the Mig-21
}
DcsBios::IntegerBuffer rsbnChanBuffer(0x2218, 0x3f80, 7, onRsbnChanChange);

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

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

Link to comment
Share on other sites

Ian;2798488']Make sure you use the latest version of DCS-BIOS and the Arduino Library (the info in BravoYankee's post has been copied out of an older version of the reference docs). Then you can use an IntegerBuffer like this:

 

Ah, sorry. I haven't updated the links on my job computer.

Link to comment
Share on other sites

Updating the Updates

 

Hi [FSF]Ian

thanks for the update:

Released v0.2.4 of the Arduino Library.

fix DcsBios::ActionButton (buttons would get stuck)

fix DCSBIOS_RS485_SLAVE on ATMega328 controllers

 

When I load the v0.2.4 into IDE, I assume I delete reference to the old library (v0.2.3)? Do I then need to reload my sketches for each panel or is that it in terms of library updates?

 

Sorry if this is a silly question.

 

Regards

 

Neal

P.S. Having great fun using this excellent programme!

Desktop PC:

Intel i7 14700K, MSI Z790 MAG Tomahawk MOBO, 64Gb RAM , GPU Nvidia RTX 3080ti

Windows 11, VPC joystick, Crosswind rudder peddles, HP Reverb G2, VPC Collective, DOF Reality H2, Gametrix seat, WinWing panels.

Link to comment
Share on other sites

Ian, in last versions DCS arduino library does not support arduino DUE. Add you support for them in future?

 

At the moment, I try to support about five different configurations:

 

  • DEFAULT_SERIAL on ATMega328 and ATMega2560 (if it works on one, it should work on the other, as it only depends on the standard Arduino Serial library)
  • IRQ_SERIAL on ATMega328
  • RS485_SLAVE on ATMega328
  • IRQ_SERIAL on ATMega2560
  • RS485_SLAVE on ATMega2560

 

I don't plan to add to that list any time soon. Every additional entry on that list means more time spent testing and less time spent implementing new features.

 

I added the Mega because it has about the same price/performance ratio as the equivalent number of GPIO pins in Arduino Nanos, several people had already started building with the Mega before I switched to interrupt-driven comms, and it was similar enough to the ATMega328 (same architecture, just different names for the peripherals, i.e. USART0 instead of USART) that it required relatively little effort to implement.

 

The Due is an ARM processor, where dealing with the serial port will probably work differently enough that I can't use the same code. And an ARM processor is overkill for the kind of panels DCS-BIOS enables, with the possible exception of drawing the CDU on a 320x240 graphic display.

 

The Due should work in DCSBIOS_DEFAULT_SERIAL mode, with the limitations that mode brings with it (i.e. possible data corruption when dealing with too many outputs or outputs that take a long time to update, like displays). Because the Due has a lot more RAM, it can probably deal with DEFAULT_SERIAL mode a lot better due to a larger receive buffer.

Link to comment
Share on other sites

When I load the v0.2.4 into IDE, I assume I delete reference to the old library (v0.2.3)? Do I then need to reload my sketches for each panel or is that it in terms of library updates?

 

It probably doesn't delete the old version because the ZIP files have different names. Check in your My Documents\Arduino\libraries folder and make sure there is only one version.

 

The change from 0.2.3 to 0.2.4 only had a minor bugfix that did not affect the protocol, so if your existing panels already work you won't have to recompile and reflash.

Link to comment
Share on other sites

Hello everyone!

Is there any easy way to do or edit debouncing? I have big problem with tact switches, smaller with momentary switches like computer power and reset ones. With one press I've got multiple input signals. :/

I'm newbie with Arduino, I found debouncing code sketches with Google but I don't really know how to combine it with DCS-BIOS. :/

I'm using some china Funduino UNO R3, no problems earlier with it.

Link to comment
Share on other sites

There is no debouncing logic in the DCS-BIOS Arduino library right now. It simply did not come up with the type of push buttons I used for my tests.

 

The physical signal on the Arduino's input pin will bounce for a certain time after a change (how long that time is mostly depends on the mechanical construction of the switch in question).

 

The logical signal (that the Arduino passes on to DCS-BIOS) will bounce if the Arduino happens to sample the physical signal twice during such a "bounce window". There are several ways to avoid this:

  • Option A: Decrease the overall polling rate. If the signal is bouncing for 2 ms but is only checked once every 20 ms, there won't be any problems.
  • Option B: Only decrease the polling rate after a change has been detected (i.e. after detecting a change, stop checking for changes for a certain amount of time).
  • Option C: like B, but only stop checking for the specific control where the input changed

 

A crude version of option A can be easily implemented by calling the delay() function from your loop() function. It's not ideal, because that delay time could be used to update outputs, but it probably won't be noticeable for reasonably small delays.

 

Option B would need a change in the DCS-BIOS Arduino library internals so that classes like Switch2Pos can tell the rest of the system "please add a debounce delay now".

 

Option C needs an individual debounce timer for each control, which needs more memory. Memory is a limited resource on the ATMega328 (we only have 2048 bytes), but the vast majority of panels should have enough to hold debounce timers for all inputs.

 

I'll probably implement option B at some point, but I'd like to focus on improvements to DCS-BIOS itself first.

Link to comment
Share on other sites

A10C CDU with 128x64 LCD screen

 

Good day every one,

Just wondering if anybody tried to make a CDU for the A10C Warthog screen, using a 164X64 dots LCD screen. Also using DCS Bios.

 

Cheers,

Adrian Fourie

Link to comment
Share on other sites

Hey Ian! I have what I suppose could be considered a bug report.

 

For the Mig 21 the "Gear up" lights for all three gears are switched off when they should be switched on and vice versa. I.e. they all come on when the gear is starting to come down. The "gear down" lights work as they should.

 

Also, the landing lights switch in the Mig 21 is behaving erratic. Connected to a 3-way switch it slmost randomly switches between off, taxi and landing when switched. This may be something in the Mig 21 code by leatherneck though, because I have seen the same behaviour when trying to connect a 3-way switch to the landing lights using a mod that edits .lua files.

 

Thanks for your awesome work!

Link to comment
Share on other sites

Hey Ian! I have what I suppose could be considered a bug report.

 

For the Mig 21 the "Gear up" lights for all three gears are switched off when they should be switched on and vice versa. I.e. they all come on when the gear is starting to come down. The "gear down" lights work as they should.

 

Thats an old bug in the export (that no one seems to bother getting fixed).

http://forums.eagle.ru/showthread.php?t=159671

  • Like 1
Link to comment
Share on other sites

onUhfFrequencyChange

 

I am using an Osram pdsp1883 eight digit display(data sheet below) to display the uhf radio display. I dont quite understand how to use the onFrequencyChange function.

How do I display the string properly? Do I reset the pointer when I hit the "\n" char? Does this onUhfFreqChange function write a single char everytime it is called? Do I make my own string buffer and read from that?

Heres my attempt at reading the uhf string

void onUhfFrequencyChange(char* newValue) {
   /* your code here */
  while(*newValue>0)
     {
           _write_to_digit_zero(*newValue++);
           _write_to_digit_one(*newValue++); 
           _write_to_digit_two(*newValue++); 
           _write_to_digit_three(*newValue++); 
           _write_to_digit_four(*newValue++); 
           _write_to_digit_five(*newValue++); 
           _write_to_digit_six(*newValue++);
            _write_to_digit_seven(0x20);//writes blank to eight display digit
            //since <string> is seven chars? 
         
     }
   
}
DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange);

/* This method writes an ascii digit to the first digit on display
the other digits are the same except for address change A0-A2 pins
*/
void _write_to_digit_zero(char my_ascii)
 {
   digitalWrite(_CE,LOW);//Chip enable
   digitalWrite(_RD,HIGH);//not used
   digitalWrite(_FL,HIGH);//Always high to write char
   digitalWrite(_A4,HIGH);//ignored
   digitalWrite(_A3,HIGH);//ignored
   digitalWrite(_A2,LOW);//next three set
   digitalWrite(_A1,LOW);//what display
   digitalWrite(_A0,LOW);//digit ascii char gets displayed on
   delay(1);
  PORTK = my_ascii;//data bus
   delay(1);
   _my_WR();//write function drops write pin low then high to write to display
 }

 

 

 

[ame=http://www.mouser.com/ds/2/311/00036139_0-280291.pdf]http://www.mouser.com/ds/2/311/00036139_0-280291.pdf[/ame]


Edited by cBass
Link to comment
Share on other sites

Hi cBass,

I can't see anything wrong with the code you posted. (The while loop does not need to be there, but wouldn't harm anything either.)

 

newValue is a 7-character C-style string (i.e. a character pointer to the first of seven bytes, followed by a null terminator). After one or more new characters have been received from DCS, when the complete update has been processed (so the local copy of the string is known to be in a consistent state), the StringBuffer class will call the onUhfFrequencyChange callback function once with the new value of the string.

 

Please post the complete sketch and tell me the model of Arduino board you are using (I guess it's a Mega because of PORTK?).

 

I assume you have tested your _write_to_digit_n functions independently and they are known to work.

 

Which version of the Arduino library are you using?

  • Like 1
Link to comment
Share on other sites

PDSP display

 

Thanks for the help Ian

The board is the Arduino Mega 2560 I do display digits from non data receiving function before the loop starts.

I am using dcsbios v0.5.0 I see the cmd window with data streaming but no character changes. Will recheck wiring if you see no problem in code.

 

/* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board
*  does not feature an ATMega328 or ATMega2650 controller.
*/
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
void onUhfFrequencyChange(char* newValue) {
   /* your code here */
          while(*newValue>0){
             _write_to_digit_zero(*newValue++);
             _write_to_digit_one (*newValue++); 
             _write_to_digit_two (*newValue++); 
             _write_to_digit_three(*newValue++); 
             _write_to_digit_four(*newValue++); 
             _write_to_digit_five(*newValue++); 
             _write_to_digit_six (*newValue++);
              _write_to_digit_seven(0x20);//writes blank to eight display digit
              //since <string> is seven chars? 
          }
}
DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange);

/*assign Display pins to Arduino pins*/
int _reset = 3;
int _FL    = A0;
int _A0    = A1;
int _A1    = A2;
int _A2    = A3;
int _A3    = A4;
int _A4    = A5;
int _WR    = 4;
int _CE    = 28;
int _RD    = 26;

void setup() {
 DcsBios::setup();
 
 /*Set direction MCU pins for controlling Display*/
 pinMode(5,OUTPUT);           /*LED heartbeat*/
 pinMode(_reset,OUTPUT);
 pinMode(_FL,OUTPUT);
 pinMode(_A0,OUTPUT);
 pinMode(_A1,OUTPUT);
 pinMode(_A2,OUTPUT);
 pinMode(_A3,OUTPUT);
 pinMode(_A4,OUTPUT);
 pinMode(_WR,OUTPUT);
 pinMode(_CE,OUTPUT);
 pinMode(_RD,OUTPUT);
 DDRK =  0xFF;               /*data bus direction*/
 PORTK = 0x00;               /*data bus initial value*/

 _my_Reset();                /*Reset the Display*/
 delay(500);
 
  /* Test write to display not using DCS data*/
 _write_to_digit_zero  (0x20);
 _write_to_digit_one   (0x30);
 _write_to_digit_two   (0x32);
 _write_to_digit_three (0x32);
 _write_to_digit_four  (0x32);
 _write_to_digit_five  (0x32);
 _write_to_digit_six   (0x32);
 _write_to_digit_seven (0x32);
 delay(2000); 
}

void loop() {
 DcsBios::loop();
 
  /* Heartbeat LED is board accepting flash*/
 digitalWrite(5, HIGH);   // turn the LED on 
 delay(1000);             // wait for a second
 digitalWrite(5, LOW);    // turn the LED off 
 delay(1000);             // wait for a second
}

/* Reset the Display ...clears character RAM
*  Flash RAM... resets internal counters
*/
void _my_Reset(void)
{
   digitalWrite(_reset,LOW);
   delay(1);
   digitalWrite(_reset,HIGH);
   delay(400);
}
void _my_WR(void)
 {
    digitalWrite(_WR,HIGH); 
    delay(1);
    digitalWrite(_WR,LOW);
    delay(1);
    digitalWrite(_WR,HIGH); 
 }

/* This Function writes to far left hand digit on Display*/
void _write_to_digit_zero(char my_ascii)
 {
   digitalWrite(_CE,LOW);    //Chip enable
   digitalWrite(_RD,HIGH);   //not used
   digitalWrite(_FL,HIGH);   //Always high to write char
   digitalWrite(_A4,HIGH);   //ignored
   digitalWrite(_A3,HIGH);   //ignored
   digitalWrite(_A2,LOW);    //next three set
   digitalWrite(_A1,LOW);    //what display
   digitalWrite(_A0,LOW);    //digit ascii char gets displayed on
   delay(1);
  PORTK = my_ascii;          //data bus ascii  character sent over this port
   delay(1);
   _my_WR();                 //write function drops write pin low then high to write to display
 }

void _write_to_digit_one(unsigned char my_ascii)
 {
   digitalWrite(_CE,LOW);
   digitalWrite(_RD,HIGH);
   digitalWrite(_FL,HIGH);
   digitalWrite(_A4,HIGH);
   digitalWrite(_A3,HIGH);
   digitalWrite(_A2,LOW);
   digitalWrite(_A1,LOW);
   digitalWrite(_A0,HIGH);
   delay(1);
   PORTK = my_ascii;
   delay(1);
   _my_WR();
 }
 void _write_to_digit_two(unsigned char my_ascii)
 {
   digitalWrite(_CE,LOW);
   digitalWrite(_RD,HIGH);
   digitalWrite(_FL,HIGH);
   digitalWrite(_A4,HIGH);
   digitalWrite(_A3,HIGH);
   digitalWrite(_A2,LOW);
   digitalWrite(_A1,HIGH);
   digitalWrite(_A0,LOW);
   delay(1);
   PORTK = my_ascii;
   delay(1);
   _my_WR();
 }

 void _write_to_digit_three(unsigned char my_ascii)
 {
   digitalWrite(_CE,LOW);
   digitalWrite(_RD,HIGH);
   digitalWrite(_FL,HIGH);
   digitalWrite(_A4,HIGH);
   digitalWrite(_A3,HIGH);
   digitalWrite(_A2,LOW);
   digitalWrite(_A1,HIGH);
   digitalWrite(_A0,HIGH);
   delay(1);
   PORTK = my_ascii;
   delay(1);
   _my_WR();
 }

void _write_to_digit_four(unsigned char my_ascii)
 {
   digitalWrite(_CE,LOW);
   digitalWrite(_RD,HIGH);
   digitalWrite(_FL,HIGH);
   digitalWrite(_A4,HIGH);
   digitalWrite(_A3,HIGH);
   digitalWrite(_A2,HIGH);
   digitalWrite(_A1,LOW);
   digitalWrite(_A0,LOW);
   delay(1);
   PORTK = my_ascii;
   delay(1);
   _my_WR();
 }  

 void _write_to_digit_five(unsigned char my_ascii)
 {
   digitalWrite(_CE,LOW);
   digitalWrite(_RD,HIGH);
   digitalWrite(_FL,HIGH);
   digitalWrite(_A4,HIGH);
   digitalWrite(_A3,HIGH);
   digitalWrite(_A2,HIGH);
   digitalWrite(_A1,LOW);
   digitalWrite(_A0,HIGH);
   delay(1);
   PORTK = my_ascii;
   delay(1);
   _my_WR();
 }

  void _write_to_digit_six(unsigned char my_ascii)
 {
   digitalWrite(_CE,LOW);
   digitalWrite(_RD,HIGH);
   digitalWrite(_FL,HIGH);
   digitalWrite(_A4,HIGH);
   digitalWrite(_A3,HIGH);
   digitalWrite(_A2,HIGH);
   digitalWrite(_A1,HIGH);
   digitalWrite(_A0,LOW);
   delay(1);
   PORTK = my_ascii;
   delay(1);
   _my_WR();
 }

/* Last digit on Display far right*/
void _write_to_digit_seven(unsigned char my_ascii)
 {
   digitalWrite(_CE,LOW);
   digitalWrite(_RD,HIGH);
   digitalWrite(_FL,HIGH);
   digitalWrite(_A4,HIGH);
   digitalWrite(_A3,HIGH);
   digitalWrite(_A2,HIGH);
   digitalWrite(_A1,HIGH);
   digitalWrite(_A0,HIGH);
   delay(1);
   PORTK = my_ascii;
   delay(1);
   _my_WR();
 }
  


Link to comment
Share on other sites

I have modified your sketch to write to a character LCD and tested it with my LCD shield. It works as expected (there is a delay of up to two seconds before it reacts to changes because of the two delay(1000) calls).

 

Here's the code I used:

/* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board
*  does not feature an ATMega328 or ATMega2650 controller.
*/
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,3,5,6,7);
void onUhfFrequencyChange(char* newValue) {
   /* your code here */
          while(*newValue>0){
             _write_to_digit_zero(*newValue++);
             _write_to_digit_one (*newValue++); 
             _write_to_digit_two (*newValue++); 
             _write_to_digit_three(*newValue++); 
             _write_to_digit_four(*newValue++); 
             _write_to_digit_five(*newValue++); 
             _write_to_digit_six (*newValue++);
              _write_to_digit_seven(0x20);//writes blank to eight display digit
              //since <string> is seven chars? 
          }
}
DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange);

/*assign Display pins to Arduino pins*/
int _reset = 3;
int _FL    = A0;
int _A0    = A1;
int _A1    = A2;
int _A2    = A3;
int _A3    = A4;
int _A4    = A5;
int _WR    = 4;
int _CE    = 28;
int _RD    = 26;

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

 _my_Reset();                /*Reset the Display*/
 delay(500);
 
  /* Test write to display not using DCS data*/
 _write_to_digit_zero  (0x20);
 _write_to_digit_one   (0x30);
 _write_to_digit_two   (0x32);
 _write_to_digit_three (0x32);
 _write_to_digit_four  (0x32);
 _write_to_digit_five  (0x32);
 _write_to_digit_six   (0x32);
 _write_to_digit_seven (0x32);
 delay(2000); 
}

void loop() {
 DcsBios::loop();
 
  /* Heartbeat LED is board accepting flash*/
 digitalWrite(5, HIGH);   // turn the LED on 
 delay(1000);             // wait for a second
 digitalWrite(5, LOW);    // turn the LED off 
 delay(1000);             // wait for a second
}

/* Reset the Display ...clears character RAM
*  Flash RAM... resets internal counters
*/
void _my_Reset(void)
{
   lcd.clear();

   delay(1);
   
   delay(400);
}
void _my_WR(void)
 {
    //digitalWrite(_WR,HIGH); 
    delay(1);
    //digitalWrite(_WR,LOW);
    delay(1);
    //digitalWrite(_WR,HIGH); 
 }

/* This Function writes to far left hand digit on Display*/
void _write_to_digit_zero(char my_ascii)
 {
   lcd.setCursor(0, 0);
   lcd.write(my_ascii);
   delay(1);
   delay(1);
   _my_WR();
 }

void _write_to_digit_one(unsigned char my_ascii)
 {
   lcd.setCursor(1, 0);
   lcd.write(my_ascii);
   delay(1);
   delay(1);
   _my_WR();
 }
 
 void _write_to_digit_two(unsigned char my_ascii)
 {
   lcd.setCursor(2, 0);
   lcd.write(my_ascii);
   delay(1);
   delay(1);
   _my_WR();
 }

 void _write_to_digit_three(unsigned char my_ascii)
 {
   lcd.setCursor(3, 0);
   lcd.write(my_ascii);
   delay(1);
   delay(1);
   _my_WR();
 }

void _write_to_digit_four(unsigned char my_ascii)
 {
   lcd.setCursor(4, 0);
   lcd.write(my_ascii);
   delay(1);
   delay(1);
   _my_WR();
 }  

 void _write_to_digit_five(unsigned char my_ascii)
 {
   lcd.setCursor(5, 0);
   lcd.write(my_ascii);
   delay(1);
   delay(1);
   _my_WR();
 }

  void _write_to_digit_six(unsigned char my_ascii)
 {
   lcd.setCursor(6, 0);
   lcd.write(my_ascii);
   delay(1);
   delay(1);
   _my_WR();
 }

/* Last digit on Display far right*/
void _write_to_digit_seven(unsigned char my_ascii)
 {
   lcd.setCursor(7, 0);
   lcd.write(my_ascii);
   delay(1);
   delay(1);
   _my_WR();
 }

 

DCS-BIOS 0.5.0, DCS-BIOS Arduino Library 0.2.3.

 

Can you get a simple example (e.g. the MasterCaution example sketch) running, to make sure that the data is getting to your Arduino board? Do you see the RX LED flashing?

I don't think it's the wiring, because you said writing characters in your setup() function works as expected.

Link to comment
Share on other sites

board updates - RS485

 

hi

 

silly question time, with all my panels connected via rs485 modules and NANOS if i need to update the sketch on a panel, can this be done via network or do i have to plug in via usb? main reason is so i can plan how frequently i would physically access the boards.

 

thanks

 

neal

Desktop PC:

Intel i7 14700K, MSI Z790 MAG Tomahawk MOBO, 64Gb RAM , GPU Nvidia RTX 3080ti

Windows 11, VPC joystick, Crosswind rudder peddles, HP Reverb G2, VPC Collective, DOF Reality H2, Gametrix seat, WinWing panels.

Link to comment
Share on other sites

with all my panels connected via rs485 modules and NANOS if i need to update the sketch on a panel, can this be done via network or do i have to plug in via usb?

 

You need to plug in via USB and you probably need a way to disconnect the MAX487's DRIVER OUTPUT line so it doesn't fight with the USB-to-serial converter.

 

In an ideal world, you'd work on your sketch in IRQ_SERIAL mode until it does what you want it to, switch it to RS485_SLAVE mode, and then never touch it again, but given that DCS-BIOS is still in an early proof-of-concept phase an occasional recompile and reflash for all panels will probably be required if/when I make changes to the communication protocol.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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