Jump to content

Recommended Posts

Posted

Hi, I've been learning the DCS-Bios framework for a couple of weeks but have got stuck on the following. I've set up a cmsp on a 2x16 LCD panel. The cmsp code is based on the code provided in another thread on this forum. It works fine until I add an LED handleGearWarning line to the code. Then only one character from the end of the second line is displayed (e.g., the G from PROG), the earlier characters are blank spaces, the first line displays as it should. I've used both a DUE and a Mega and seem to get the same issue (using version 0.2.2 with 0.5.0).

 

Code is listed below - any help appreciated.

 

 

#define DCSBIOS_DEFAULT_SERIAL
#include "DcsBios.h"
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F, 16, 2);

DcsBios::LED handleGearWarning(0x1026, 0x4000, 7); // <-- this line causes a problem

void onCmsp1Change(char* cmsp1) {
 lcd.setCursor(0,0);
 lcd.print(cmsp1[0]);
 lcd.print(cmsp1[1]);
 lcd.print(cmsp1[2]);
 lcd.print(cmsp1[3]);
 lcd.print(cmsp1[5]);
 lcd.print(cmsp1[6]);
 lcd.print(cmsp1[7]);
 lcd.print(cmsp1[8]);
 lcd.print(cmsp1[10]);
 lcd.print(cmsp1[11]);
 lcd.print(cmsp1[12]);
 lcd.print(cmsp1[13]);
 lcd.print(cmsp1[15]);
 lcd.print(cmsp1[16]);
 lcd.print(cmsp1[17]);
 lcd.print(cmsp1[18]);  
}
DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change);

void onCmsp2Change(char* cmsp2) {
 lcd.setCursor(0,1);
 lcd.print(cmsp2[0]);
 lcd.print(cmsp2[1]);
 lcd.print(cmsp2[2]);
 lcd.print(cmsp2[3]);
 lcd.print(cmsp2[5]);
 lcd.print(cmsp2[6]);
 lcd.print(cmsp2[7]);
 lcd.print(cmsp2[8]);
 lcd.print(cmsp2[10]);
 lcd.print(cmsp2[11]);
 lcd.print(cmsp2[12]);
 lcd.print(cmsp2[13]);
 lcd.print(cmsp2[15]);
 lcd.print(cmsp2[16]);
 lcd.print(cmsp2[17]);
 lcd.print(cmsp2[18]);  
}
DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change);

//---------------------------------------------------------------------------------------------

void setup() {
 DcsBios::setup();
 lcd.begin();
 lcd.backlight();
 lcd.print("ready");
}

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

  • Recently Browsing   0 members

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