dgw Posted April 18, 2016 Posted April 18, 2016 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(); }
FSFIan Posted April 18, 2016 Posted April 18, 2016 I am aware of this and am looking into it. See also: https://github.com/dcs-bios/dcs-bios/issues/87 DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
dgw Posted April 19, 2016 Author Posted April 19, 2016 Thanks - no rush (being new to this I'd assumed it was an error in my code somewhere)
FSFIan Posted April 19, 2016 Posted April 19, 2016 Try the new v0.2.3 release of the Arduino library, that should fix your issue. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
dgw Posted April 19, 2016 Author Posted April 19, 2016 hi, thanks - yes that fixed it, much appreciated, d.
Recommended Posts