Dadzilla74 Posted September 24, 2019 Posted September 24, 2019 Hi all, I have the Scratchpad display working ok using a 16x2 display using i2c. https://www.jaycar.com.au/dot-matrix-white-on-blue-lcd-16x2-character/p/QP5521 There are some minor issues that someone might know how to fix. 1/ I have had to move the scratchpadstring2displaychange to 2,0 as it was deleting the string1display if a number was placed into 1,0 such as com select does. This mean that the ON looks like 'O N' and not 'ON'. Also the numbers now look like "10_". 2/ The TCN numer 1 that appears on the right of the scratchpad gets displayed at 12,0 and not 16,0 as the 1 in ILS does. 3? The D/L number 127 appears in 10,0;11,0;12,0 and not 14,0;15,0;16,0. Any workaround suggestion would be greatly appreciated. #define DCSBIOS_DEFAULT_SERIAL #include "DcsBios.h" #include <LiquidCrystal_I2C.h> const int en = 2, rw = 1, rs = 0, d4 = 4, d5 = 5, d6 = 6, d7 = 7, bl = 3; const int i2c_addr = 0x27; LiquidCrystal_I2C lcd(i2c_addr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE); void onUfcScratchpadString1DisplayChange(char* newValue) { // Print on first row String sNewValue(newValue); sNewValue.replace('~','2'); sNewValue.replace('`','1'); lcd.setCursor(0,0); lcd.print(sNewValue); } DcsBios::StringBuffer<2> ufcScratchpadString1DisplayBuffer(0x5446, onUfcScratchpadString1DisplayChange); void onUfcScratchpadString2DisplayChange(char* newValue) { lcd.setCursor(2,0); lcd.print(newValue); } DcsBios::StringBuffer<2> ufcScratchpadString2DisplayBuffer(0x5448, onUfcScratchpadString2DisplayChange); void onUfcScratchpadNumberDisplayChange(char* newValue) { lcd.setCursor(9,0); lcd.print(newValue); } DcsBios::StringBuffer<8> ufcScratchpadNumberDisplayBuffer(0x543e, onUfcScratchpadNumberDisplayChange); void setup() { lcd.begin(16, 2); lcd.clear(); DcsBios::setup(); } void loop() { DcsBios::loop(); }
Recommended Posts