Heling Posted February 8, 2021 Share Posted February 8, 2021 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 More sharing options...
No1sonuk Posted February 8, 2021 Share Posted February 8, 2021 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 More sharing options...
Heling Posted February 8, 2021 Author Share Posted February 8, 2021 It' very similar to my codes and still no output with your code. Will try with a LCD and LiquidCristal -Library. I will report here. Link to comment Share on other sites More sharing options...
pavidovich Posted February 9, 2021 Share Posted February 9, 2021 are you obtaining any output in the OLED screen? or it just remains black? Link to comment Share on other sites More sharing options...
Heling Posted February 9, 2021 Author Share Posted February 9, 2021 What I wrote inside the 'void setup' appears on the OLED without problems. The I2C works fine. Link to comment Share on other sites More sharing options...
pavidovich Posted February 9, 2021 Share Posted February 9, 2021 hace 4 minutos, Heling dijo: What I wrote inside the 'void setup' appears on the OLED without problems. The I2C works fine. I mean inside the DCS-Bios function Link to comment Share on other sites More sharing options...
Heling Posted February 9, 2021 Author Share Posted February 9, 2021 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 More sharing options...
pavidovich Posted February 9, 2021 Share Posted February 9, 2021 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 interruptionsEnviado desde mi SM-A105FN mediante Tapatalk Link to comment Share on other sites More sharing options...
Hansolo Posted February 9, 2021 Share Posted February 9, 2021 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 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
Heling Posted February 9, 2021 Author Share Posted February 9, 2021 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 More sharing options...
No1sonuk Posted February 9, 2021 Share Posted February 9, 2021 Maybe this can help: https://startingelectronics.org/software/arduino/learn-to-program-course/18-strings/ Link to comment Share on other sites More sharing options...
Heling Posted February 9, 2021 Author Share Posted February 9, 2021 I do not know. I switched from a Mega 2560 to a Uno and now it works. What a hassle. I deal with the forum here and then something. Thank you guys! Link to comment Share on other sites More sharing options...
Recommended Posts