Jump to content

No Output


Heling
 Share

Recommended Posts

Hi folks,

I've a short code for testing. Whatever I tried - there is no output possible inside the function.  I worked with different libraries, but it's still no working.

Watch the comments inside the code. What's the trick with DCS-Bios?
 

/* CMSP-Display */

#define DCSBIOS_IRQ_SERIAL
#include <DcsBios.h>
#include <Wire.h>
#include "OLedI2C.h"



OLedI2C lcd;

// The output to the 20 x 2 OLED works fine her in the setup area:
void setup() {
  DcsBios::setup();
  Wire.begin();
   //lcd.setContrast(0x0A); // contrast as 0x00 to 0xFF
  lcd.init();
  
  lcd.sendString("SBY AIR ",0,0);    // This three lines aro working good!
  lcd.sendString("c120f240",12,0);
  lcd.sendString("ACTIVE  ",0,1);
  delay(999);
}


// Here the function without any output:
//Jammer Display --------------------------
 void onCmscTxtJmrChange(char* newValue) {
     //newValue = ("Test");  			// not working :(
     lcd.clear();						// not working :(
     lcd.sendString(newValue,0,0);      // not working :(
}
DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);


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

 

Link to comment
Share on other sites

This is a section of code in a test program I wrote for the A10 CMSP display.
This uses the LiquidCrystal_I2C library, but you might be able to adapt it for your library:
 

// This setion reads the CMS display strings and sends them to the LCD

void onCmsp1Change(char* newValue) {
  lcd.setCursor(0,0);  // set cursor position (column,line) starting at 0
  lcd.print(newValue);  // Write the line to the display
}
DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change);

void onCmsp2Change(char* newValue) {
  lcd.setCursor(0,1);  // set cursor position (column,line) starting at 0
  lcd.print(newValue);  // Write the line to the display
}
DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change);

// End of CMS display string section

 

Link to comment
Share on other sites

Yes, inside the DCS-BIOS function nothing works. In my example below you see I tried with a given string "Test" but it will not going to the OLED.

 void onCmscTxtJmrChange(char* newValue) {
     //newValue = ("Test");  			// not working :(
     lcd.clear();						// not working :(
     lcd.sendString(newValue,0,0);      // not working :(
}
DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);

 

Link to comment
Share on other sites

My suggestion is to try with any other Oled display library and finally without the IRQ Serial option.

In my opinion the Oled library is doing something that could affect the interruptions


Enviado desde mi SM-A105FN mediante Tapatalk

Link to comment
Share on other sites

Not sure what module you are running but for the A-10C you need to have a viewport for the CMSP, CMSC and UHF. E.g. you need to export it to you monitor first, it doesn't have to be large and IIRCC it doesn't have to be visible e.g. you can export it outside your visible screen area. Below screen dump is from the original manual. Granted may have changed.

 

Cheers

Solo

A-10C CMSP, CMSC and UHF notes.png

Link to comment
Share on other sites

At the moment, I have DCS-A10 started like a PC-game on my monitor. The DCS BIOS Hub is running and he shows me the changes on CMSC. And then I connect to my Arduino port. In this moment, my default text disappears and nothing fills the given positions the OLED. I think the viewport should be okay in this configuration.  The UHF-Frequency works fine, but with a light different function. But I can't do that with the CMSC:

void updateComDisplay(int changed,char* newValue) {
comDisplay[changed] = cleanUpCom(newValue);
display.clearDisplay();
display.setCursor(0,10);
display.print(comDisplay[0]);
//display.setCursor(0,10);
//display.print(comDisplay[1]);

display.display();
}

char* cleanUpCom(char* newValue) {
switch (newValue[0]) {
case '`':
newValue[0]='1';
break;
case '~':
newValue[0]='2';
break;
}
return newValue;
}

void onUhfFrequencyChange(char* newValue) {
updateComDisplay(0, newValue);
}
DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange);

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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