triise Posted March 16, 2015 Posted March 16, 2015 Hi, I'm trying to get DCS BIOS to display the CMSP on a 16x2 LCD display hooked up to my arduino. I can see that DCS BIOS doesn't include the code, and I've been trying to search the net for some tips or some code I can include in my sketch. I have the LCD up and running, and have the DCS BIOS template loaded. But from there I'm a bit stuck... Anyone care to shed some light on this? (I'm pretty new to Arduino, so It maybe a bit easier or harder than I think maybe...) Regards, Tore - Newbie simpit builder and electronics geek -
FSFIan Posted March 17, 2015 Posted March 17, 2015 Watch for the basics. If you had a 20x2 display, that would be all you need. Each CMSP line is exported as a 19-character string (e.g. "CHAF FLAR OTR1 PROG"). To fit that on a 16-character display line, we can ignore the spaces at (zero-based) positions 4, 9 and 15, so you get "CHAFFLAROTR1PROG" instead: void onCmsp1Change(char* newValue) { lcd.setCursor(0, 0); lcd.write(newValue[0]); lcd.write(newValue[1]); lcd.write(newValue[2]); lcd.write(newValue[3]); lcd.write(newValue[5]); lcd.write(newValue[6]); lcd.write(newValue[7]); lcd.write(newValue[8]); lcd.write(newValue[10]); lcd.write(newValue[11]); lcd.write(newValue[12]); lcd.write(newValue[13]); lcd.write(newValue[15]); lcd.write(newValue[16]); lcd.write(newValue[17]); lcd.write(newValue[18]); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); void onCmsp2Change(char* newValue) { lcd.setCursor(0, 1); lcd.write(newValue[0]); lcd.write(newValue[1]); lcd.write(newValue[2]); lcd.write(newValue[3]); lcd.write(newValue[5]); lcd.write(newValue[6]); lcd.write(newValue[7]); lcd.write(newValue[8]); lcd.write(newValue[10]); lcd.write(newValue[11]); lcd.write(newValue[12]); lcd.write(newValue[13]); lcd.write(newValue[15]); lcd.write(newValue[16]); lcd.write(newValue[17]); lcd.write(newValue[18]); } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); I can see that DCS BIOS doesn't include the code That's because there are so many different things you might want to do with string values that it does not make sense to generate example code for all of them: display them on a LCD character display with a HD44780 compatible controller, which can be connected in several different ways (4-bit parallel, 8-bit parallel, over an I2C I/O expander) display it on a graphical display (while the HD44780 chip has set a de-facto standard for how to control a character display, graphical displays tend to feature a greater variety of controller chips) display only a part of it (as in the above example) display it on a 7-segment display (for example the UHF frequency), which again may be connected to an Arduino in numerous ways Therefore, for string values, you get a piece of example code that calls a function every time the value changes. You need to put your own "glue code" into that function to actually do something with the string value. In most cases, that function is very short because you can find an existing Arduino library that does the bulk of the work and already knows how to talk to whatever hardware you have connected (in this case the LiquidCrystal library). DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
triise Posted March 26, 2015 Author Posted March 26, 2015 Thanks for the feedback. I've bought some 20x02 displays and they work like a charm. Actually got them to fit inside the standard dimensions CMSP. Regards, Tore - Newbie simpit builder and electronics geek -
agrasyuk Posted March 27, 2015 Posted March 27, 2015 Nope . Standard dimention CMSP has the " next " and "rtn" buttons side by side not above each other, so technically you didn't fit it ;) Not that I mind though, I can see making those kind of compromises . Anton. My pit build thread . Simple and cheap UFC project
triise Posted March 31, 2015 Author Posted March 31, 2015 Nope . Standard dimention CMSP has the " next " and "rtn" buttons side by side not above each other, so technically you didn't fit it ;) Not that I mind though, I can see making those kind of compromises . Yep, you are certainly correct about that. What I meant was that it did fit within the overall dimensions of the panel. ;) I'm all into compromises, as long as it looks realistic and is functional :pilotfly: Regards, Tore Regards, Tore - Newbie simpit builder and electronics geek -
Recommended Posts