1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-26 17:46:14 +01:00

Update LCD driver to make it more reliable

Delay times at startup extended to make start-up configuration more reliable.
This commit is contained in:
Neil McKechnie 2023-02-21 11:00:27 +00:00
parent a36dccfad0
commit 43b1e8db21
2 changed files with 5 additions and 5 deletions

View File

@ -80,15 +80,15 @@ bool LiquidCrystal_I2C::begin() {
// we start in 8bit mode, try to set 4 bit mode // we start in 8bit mode, try to set 4 bit mode
write4bits(0x03); write4bits(0x03);
delayMicroseconds(4500); // wait min 4.1ms delayMicroseconds(5000); // wait min 4.1ms
// second try // second try
write4bits(0x03); write4bits(0x03);
delayMicroseconds(4500); // wait min 4.1ms delayMicroseconds(5000); // wait min 4.1ms
// third go! // third go!
write4bits(0x03); write4bits(0x03);
delayMicroseconds(150); delayMicroseconds(5000);
// finally, set to 4-bit interface // finally, set to 4-bit interface
write4bits(0x02); write4bits(0x02);
@ -112,7 +112,7 @@ bool LiquidCrystal_I2C::begin() {
/********** high level commands, for the user! */ /********** high level commands, for the user! */
void LiquidCrystal_I2C::clearNative() { void LiquidCrystal_I2C::clearNative() {
command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero
delayMicroseconds(1600); // this command takes 1.52ms delayMicroseconds(2000); // this command takes 1.52ms but allow plenty
} }
void LiquidCrystal_I2C::setRowNative(byte row) { void LiquidCrystal_I2C::setRowNative(byte row) {

View File

@ -90,7 +90,7 @@ private:
uint8_t _displayfunction; uint8_t _displayfunction;
uint8_t _displaycontrol; uint8_t _displaycontrol;
uint8_t _displaymode; uint8_t _displaymode;
uint8_t _backlightval; uint8_t _backlightval = 0;
uint8_t outputBuffer[4]; uint8_t outputBuffer[4];
I2CRB rb; I2CRB rb;