Kenpilot Posted April 16, 2023 Posted April 16, 2023 Building the A10 CMSP and using an Arduino Mega and IIC / I2C 2002 20x02 OLED Module Display. Anyone care to be kind enough to share their Arduino sketch for the display? I'm clueless when it comes to writing them for displays. Thanks!! Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
Vinc_Vega Posted April 16, 2023 Posted April 16, 2023 Do you mean somethin like that? // first charracter line on CSMP display void onCmsp1Change(char* newValue) { lcd.setCursor(0,0); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); // second charracter line on CSMP display void onCmsp2Change(char* newValue) { lcd.setCursor(0,1); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); Regards, Vinc Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
Kenpilot Posted April 17, 2023 Author Posted April 17, 2023 10 hours ago, Vinc_Vega said: Do you mean somethin like that? // first charracter line on CSMP display void onCmsp1Change(char* newValue) { lcd.setCursor(0,0); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); // second charracter line on CSMP display void onCmsp2Change(char* newValue) { lcd.setCursor(0,1); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); Regards, Vinc That looks about right, thanks Vinc! I'm still building the panel but I'll test it out once I finish it. Thanks again!! Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
760mm Posted May 27 Posted May 27 On 4/16/2023 at 7:04 PM, Vinc_Vega said: Do you mean somethin like that? // first charracter line on CSMP display void onCmsp1Change(char* newValue) { lcd.setCursor(0,0); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); // second charracter line on CSMP display void onCmsp2Change(char* newValue) { lcd.setCursor(0,1); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); Regards, Vinc Thank you for this code. This is useful, but requires additional libraries. Which libraries do I need to specify to work with this display (OP202i IIC / I2C 2002 20x02 OLED Module Display) and export using https://github.com/DCS-Skunkworks/dcs-bios? If you have a complete sketch, could you share it?
Vinc_Vega Posted May 27 Posted May 27 It may have the SSD1306 chip, try this library to talk to your display: https://github.com/gadjet/1602-OLED-Arduino-Library Regards, Vinc 1 Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
Kenpilot Posted May 28 Author Posted May 28 6 hours ago, 760mm said: Thank you for this code. This is useful, but requires additional libraries. Which libraries do I need to specify to work with this display (OP202i IIC / I2C 2002 20x02 OLED Module Display) and export using https://github.com/DCS-Skunkworks/dcs-bios? If you have a complete sketch, could you share it? #include <LiquidCrystal_PCF8574.h> /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. This should work on any Arduino that has an ATMega328 controller (Uno, Pro Mini, many others). */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include "Wire.h" #include "OLedI2C.h" OLedI2C LCD; void onCmsp1Change(char* newValue) { LCD.sendString(newValue,0,0); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); // ----- print the second line to the LCD display ----- void onCmsp2Change(char* newValue) { LCD.sendString(newValue,0,1); //Now includes the cursor position data (col, row) } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); const byte cmspModePins[5] = {A0, A1, A2, A3, A4}; DcsBios::SwitchMultiPos cmspMode("CMSP_MODE", cmspModePins, 5); DcsBios::Switch2Pos cmspArw1("CMSP_ARW1", 10); DcsBios::Switch2Pos cmspArw2("CMSP_ARW2", 11); DcsBios::Switch2Pos cmspArw3("CMSP_ARW3", 12); DcsBios::Switch2Pos cmspArw4("CMSP_ARW4", 13); DcsBios::Switch3Pos cmspMws("CMSP_MWS", 3, 2); DcsBios::Switch3Pos cmspJmr("CMSP_JMR", 5, 4); DcsBios::Switch3Pos cmspRwr("CMSP_RWR", 7, 6); DcsBios::Switch3Pos cmspDisp("CMSP_DISP", 9, 8); DcsBios::Switch2Pos cmspJtsn("CMSP_JTSN", 17); DcsBios::Switch2Pos cmspRtn("CMSP_RTN", 16); DcsBios::Switch3Pos cmspUpdn("CMSP_UPDN", 15, 14); void setup() {DcsBios::setup(); Wire.begin(); LCD.init(); } void loop() { DcsBios::loop(); } 1 Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
760mm Posted May 28 Posted May 28 (edited) @Kenpilot Thank you very much for your sketch! I think I'm doing something wrong. I have installed these libraries: https://github.com/mathertel/LiquidCrystal_PCF8574 https://github.com/gadjet/1602-OLED-Arduino-Library https://github.com/DCS-Skunkworks/dcs-bios-arduino-library , but I still get an error when compiling: In file included from D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:1:0: D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h: In function 'bool sendDcsBiosMessage(const char*, const char*)': D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h:176:18: error: 'tryToSendDcsBiosMessage' is not a member of 'DcsBios' while(!DcsBios::tryToSendDcsBiosMessage(msg, arg)); ^~~~~~~~~~~~~~~~~~~~~~~ D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h:176:18: note: suggested alternative: 'sendDcsBiosMessage' while(!DcsBios::tryToSendDcsBiosMessage(msg, arg)); ^~~~~~~~~~~~~~~~~~~~~~~ sendDcsBiosMessage D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino: In function 'void setup()': D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:55:13: error: 'setup' is not a member of 'DcsBios' {DcsBios::setup(); ^~~~~ D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:55:13: note: suggested alternative: D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:54:6: note: 'setup' void setup() ^~~~~ D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino: In function 'void loop()': D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:62:12: error: 'loop' is not a member of 'DcsBios' DcsBios::loop(); ^~~~ D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:62:12: note: suggested alternative: D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:61:6: note: 'loop' void loop() { ^~~~ exit status 1 Compilation error: 'setup' is not a member of 'DcsBios' Edited May 28 by 760mm
760mm Posted June 1 Posted June 1 Very strange: I found library OLedI2C.h but maybe it is not for op202i 20x2 display. 8-( Can't make it works. 8-(
Rapti Posted June 11 Posted June 11 We use this display. Don't know if its the same than yours. IIC / I2C 2002 20x02 OLED Module Display Our Code: this work on our side. #define DCSBIOS_DEFAULT_SERIAL #include "DcsBios.h" #include "Wire.h" #include "OLedI2C.h" OLedI2C LCD; /* paste code snippets from the reference documentation here */ void onCmsp1Change(char* newValue) { LCD.sendString(newValue, 0, 0); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); void onCmsp2Change(char* newValue) { LCD.sendString(newValue, 0, 1); } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); void setup() { DcsBios::setup(); Wire.begin(); LCD.init(); } void loop() { DcsBios::loop(); }
Kenpilot Posted June 22 Author Posted June 22 On 5/28/2025 at 3:41 PM, 760mm said: @Kenpilot Thank you very much for your sketch! I think I'm doing something wrong. I have installed these libraries: https://github.com/mathertel/LiquidCrystal_PCF8574 https://github.com/gadjet/1602-OLED-Arduino-Library https://github.com/DCS-Skunkworks/dcs-bios-arduino-library , but I still get an error when compiling: In file included from D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:1:0: D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h: In function 'bool sendDcsBiosMessage(const char*, const char*)': D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h:176:18: error: 'tryToSendDcsBiosMessage' is not a member of 'DcsBios' while(!DcsBios::tryToSendDcsBiosMessage(msg, arg)); ^~~~~~~~~~~~~~~~~~~~~~~ D:\Users\user\Documents\Arduino\libraries\DCS-BIOS\src/DcsBios.h:176:18: note: suggested alternative: 'sendDcsBiosMessage' while(!DcsBios::tryToSendDcsBiosMessage(msg, arg)); ^~~~~~~~~~~~~~~~~~~~~~~ sendDcsBiosMessage D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino: In function 'void setup()': D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:55:13: error: 'setup' is not a member of 'DcsBios' {DcsBios::setup(); ^~~~~ D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:55:13: note: suggested alternative: D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:54:6: note: 'setup' void setup() ^~~~~ D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino: In function 'void loop()': D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:62:12: error: 'loop' is not a member of 'DcsBios' DcsBios::loop(); ^~~~ D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:62:12: note: suggested alternative: D:\Users\user\Documents\Arduino\sketch_may28a\sketch_may28a.ino:61:6: note: 'loop' void loop() { ^~~~ exit status 1 Compilation error: 'setup' is not a member of 'DcsBios' Can you post your sketch? Looks like something going on with DcsBios. Do you have the latest DcsBios library? Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
Recommended Posts