Jump to content

Recommended Posts

Posted

Building the A10 CMSP and using an Arduino Mega and IIC / I2C 2002 20x02 OLED Module Display. Anyone care to be kind enough to share their Arduino sketch for the display?  I'm clueless when it comes to writing them for displays. Thanks!! 

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

Posted

Do you mean somethin like that?

// first charracter line on CSMP display
void onCmsp1Change(char* newValue) {
      lcd.setCursor(0,0);
      lcd.print(newValue);
}
DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change);

// second charracter line on CSMP display
void onCmsp2Change(char* newValue) {
      lcd.setCursor(0,1);
      lcd.print(newValue);
}
DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change);

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted
10 hours ago, Vinc_Vega said:

Do you mean somethin like that?

// first charracter line on CSMP display
void onCmsp1Change(char* newValue) {
      lcd.setCursor(0,0);
      lcd.print(newValue);
}
DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change);

// second charracter line on CSMP display
void onCmsp2Change(char* newValue) {
      lcd.setCursor(0,1);
      lcd.print(newValue);
}
DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change);

Regards, Vinc

That looks about right, thanks Vinc! I'm still building the panel but I'll test it out once I finish it. Thanks again!! 

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

  • 2 years later...
Posted
On 4/16/2023 at 7:04 PM, Vinc_Vega said:

Do you mean somethin like that?

// first charracter line on CSMP display
void onCmsp1Change(char* newValue) {
      lcd.setCursor(0,0);
      lcd.print(newValue);
}
DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change);

// second charracter line on CSMP display
void onCmsp2Change(char* newValue) {
      lcd.setCursor(0,1);
      lcd.print(newValue);
}
DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change);

Regards, Vinc

 

Thank you for this code. This is useful, but requires additional libraries. Which libraries do I need to specify to work with this display (OP202i IIC / I2C 2002 20x02 OLED Module Display) and export using https://github.com/DCS-Skunkworks/dcs-bios? If you have a complete sketch, could you share it?

Posted
6 hours ago, 760mm said:

 

Thank you for this code. This is useful, but requires additional libraries. Which libraries do I need to specify to work with this display (OP202i IIC / I2C 2002 20x02 OLED Module Display) and export using https://github.com/DCS-Skunkworks/dcs-bios? If you have a complete sketch, could you share it?

#include <LiquidCrystal_PCF8574.h>
 
/*
  Tell DCS-BIOS to use a serial connection and use interrupt-driven
  communication. The main program will be interrupted to prioritize
  processing incoming data.
 
  This should work on any Arduino that has an ATMega328 controller
  (Uno, Pro Mini, many others).
 */
#define DCSBIOS_IRQ_SERIAL
 
#include "DcsBios.h"
#include "Wire.h"
#include "OLedI2C.h"
OLedI2C LCD;
 
void onCmsp1Change(char* newValue) {
   LCD.sendString(newValue,0,0);
}
DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change);
 
// ----- print the second line to the LCD display -----
void onCmsp2Change(char* newValue) {
      LCD.sendString(newValue,0,1);  //Now includes the cursor position data (col, row)
}
DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change);
 
const byte cmspModePins[5] = {A0, A1, A2, A3, A4};
DcsBios::SwitchMultiPos cmspMode("CMSP_MODE", cmspModePins, 5);
 
DcsBios::Switch2Pos cmspArw1("CMSP_ARW1", 10);
DcsBios::Switch2Pos cmspArw2("CMSP_ARW2", 11);
DcsBios::Switch2Pos cmspArw3("CMSP_ARW3", 12);
DcsBios::Switch2Pos cmspArw4("CMSP_ARW4", 13);
 
DcsBios::Switch3Pos cmspMws("CMSP_MWS", 3, 2);
DcsBios::Switch3Pos cmspJmr("CMSP_JMR", 5, 4);
DcsBios::Switch3Pos cmspRwr("CMSP_RWR", 7, 6);
DcsBios::Switch3Pos cmspDisp("CMSP_DISP", 9, 8);
 
DcsBios::Switch2Pos cmspJtsn("CMSP_JTSN", 17);
 
DcsBios::Switch2Pos cmspRtn("CMSP_RTN", 16);
 
DcsBios::Switch3Pos cmspUpdn("CMSP_UPDN", 15, 14);


 
void setup()
  {DcsBios::setup();
    Wire.begin();
    LCD.init();
 
}
 
void loop() {
  DcsBios::loop();
}
  • Like 1

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

Posted (edited)

@Kenpilot Thank you very much for your sketch! I think I'm doing something wrong. I have installed these libraries:

https://github.com/mathertel/LiquidCrystal_PCF8574
https://github.com/gadjet/1602-OLED-Arduino-Library
https://github.com/DCS-Skunkworks/dcs-bios-arduino-library
, but I still get an error when compiling:
 

In file included from D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:1:0:
D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h: In function 'bool sendDcsBiosMessage(const char*, const char*)':
D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h:176:18: error: 'tryToSendDcsBiosMessage' is not a member of 'DcsBios'
  while(!DcsBios::tryToSendDcsBiosMessage(msg, arg));
                  ^~~~~~~~~~~~~~~~~~~~~~~
D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h:176:18: note: suggested alternative: 'sendDcsBiosMessage'
  while(!DcsBios::tryToSendDcsBiosMessage(msg, arg));
                  ^~~~~~~~~~~~~~~~~~~~~~~
                  sendDcsBiosMessage
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino: In function 'void setup()':
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:55:13: error: 'setup' is not a member of 'DcsBios'
   {DcsBios::setup();
             ^~~~~
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:55:13: note: suggested alternative:
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:54:6: note:   'setup'
 void setup()
      ^~~~~
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino: In function 'void loop()':
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:62:12: error: 'loop' is not a member of 'DcsBios'
   DcsBios::loop();
            ^~~~
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:62:12: note: suggested alternative:
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:61:6: note:   'loop'
 void loop() {
      ^~~~
exit status 1

Compilation error: 'setup' is not a member of 'DcsBios'

Edited by 760mm
Posted

Very strange: I found library OLedI2C.h but maybe it is not for op202i 20x2 display. 8-( Can't make it works. 8-(

  • 2 weeks later...
Posted

We use this display. Don't know if its the same than yours.
IIC / I2C 2002 20x02 OLED Module Display


Our Code: 

this work on our side.

#define DCSBIOS_DEFAULT_SERIAL

#include "DcsBios.h"
#include  "Wire.h"    
#include  "OLedI2C.h"  
OLedI2C LCD;

/* paste code snippets from the reference documentation here */
void onCmsp1Change(char* newValue) {
   LCD.sendString(newValue, 0, 0);
}
DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change);

void onCmsp2Change(char* newValue) {
   LCD.sendString(newValue, 0, 1); 
}
DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change);


void setup() {
 DcsBios::setup();
   Wire.begin();
 LCD.init();  
}

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

 

  • 2 weeks later...
Posted
On 5/28/2025 at 3:41 PM, 760mm said:

@Kenpilot Thank you very much for your sketch! I think I'm doing something wrong. I have installed these libraries:

https://github.com/mathertel/LiquidCrystal_PCF8574
https://github.com/gadjet/1602-OLED-Arduino-Library
https://github.com/DCS-Skunkworks/dcs-bios-arduino-library
, but I still get an error when compiling:
 

In file included from D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:1:0:
D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h: In function 'bool sendDcsBiosMessage(const char*, const char*)':
D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h:176:18: error: 'tryToSendDcsBiosMessage' is not a member of 'DcsBios'
  while(!DcsBios::tryToSendDcsBiosMessage(msg, arg));
                  ^~~~~~~~~~~~~~~~~~~~~~~
D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h:176:18: note: suggested alternative: 'sendDcsBiosMessage'
  while(!DcsBios::tryToSendDcsBiosMessage(msg, arg));
                  ^~~~~~~~~~~~~~~~~~~~~~~
                  sendDcsBiosMessage
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino: In function 'void setup()':
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:55:13: error: 'setup' is not a member of 'DcsBios'
   {DcsBios::setup();
             ^~~~~
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:55:13: note: suggested alternative:
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:54:6: note:   'setup'
 void setup()
      ^~~~~
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino: In function 'void loop()':
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:62:12: error: 'loop' is not a member of 'DcsBios'
   DcsBios::loop();
            ^~~~
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:62:12: note: suggested alternative:
D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:61:6: note:   'loop'
 void loop() {
      ^~~~
exit status 1

Compilation error: 'setup' is not a member of 'DcsBios'

Can you post your sketch? Looks like something going on with DcsBios. Do you have the latest DcsBios library? 

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

  • 3 months later...
Posted (edited)
В 22.06.2025 в 05:43, Kenpilot сказал:

Can you post your sketch? Looks like something going on with DcsBios. Do you have the latest DcsBios library? 

 
 

I'm sorry, I've been out of the discussion for a while.

I tried the two sketches above, but the screen is still black.I downloaded and installed DCS BOIS from here: https://github.com/DCS-Skunkworks/dcs-bios

I'm trying to use an Arduino UNO. Do I understand correctly that I have to connect the contacts of the screen with the same ones on the Arduino: SDL, SDA, GND and VCC (5V)?

Edited by 760mm
Posted
29 минут назад, Rapti сказал:

null

image.png

Thanks! I don't understand what I'm doing wrong. I downloaded the DCS-BIOS and unzipped it in Scripts.

Here is my export.lua. dofile(lfs.writedir() .. [[Scripts\DCS-BIOS\BIOS.lua]])

-- load the DCS ExportScript for DAC and Ikarus
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\ExportScript.lua]])

local FFBeastlfs=require('lfs');dofile(FFBeastlfs.writedir()..'Scripts/FFbeastGameExport.lua')

dofile(lfs.writedir()..[[Scripts\Helios\HeliosExport16.lua]])

The screen is still black. 

image (2).png

Posted

Have you ever done a test independently of DCS BIOS? With an example sketch for the display?
Maybe the display is defective?

Posted
2 минуты назад, Rapti сказал:

Have you ever done a test independently of DCS BIOS? With an example sketch for the display?
Maybe the display is defective?

Yes, I did it! Hello World screen displays normally.

Posted (edited)

I checked the connection in DCS BIOS Bort. There is a connection to the DCS BIOS, CSMP values are displayed in the Bort, but not on the display.
I've
upgraded the sketch. Now it shows No DCS BIOS connection all the time.

#define DCSBIOS_DEFAULT_SERIAL
 
#include "DcsBios.h"
#include "Wire.h"    
#include "OLedI2C.h"  
 
OLedI2C LCD;
 
// Флаг для отслеживания связи
bool dcsConnected = false;
unsigned long lastConnectionCheck = 0;
 
void onCmsp1Change(char* newValue) {
   LCD.sendString(newValue, 0, 0);
   dcsConnected = true;  // Данные приходят - связь есть
   lastConnectionCheck = millis();
}
DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change);
 
void onCmsp2Change(char* newValue) {
   LCD.sendString(newValue, 0, 1);
   dcsConnected = true;  // Данные приходят - связь есть
   lastConnectionCheck = millis();
}
DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change);
 
void checkConnection() {
    // Проверяем каждые 2 секунды
    if (millis() - lastConnectionCheck > 2000) {
        dcsConnected = false;
        LCD.sendString("No DCS BIOS", 0, 0);        // Первая строка
        LCD.sendString("connection", 0, 1);         // Вторая строка
    }
}
 
void setup() {
    DcsBios::setup();
    Wire.begin();
    LCD.init();  
    lastConnectionCheck = millis();
}
 
void loop() {
    DcsBios::loop();
    checkConnection();
}
Edited by 760mm
Posted (edited)

To be sure, you must also render the CMSC display on a monitor, otherwise it will not be shown on your external display.
We had this problem with our simulator. We hide the cockpit, but we still have to render the CMSC display on a monitor (in our case, the monitor for the instrument panel). It is sufficient if the size is 1x1 pixel.
If this is not done, the external display will not show anything.

Edited by Rapti
  • Recently Browsing   0 members

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