Skip to content

Commit 626a875

Browse files
committed
decrease wait time between command execution
1 parent 68eba67 commit 626a875

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/LiquidCrystal.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
119119

120120
// we start in 8bit mode, try to set 4 bit mode
121121
write4bits(0x03);
122-
delayMicroseconds(4500); // wait min 4.1ms
122+
delayMicroseconds(4400); // wait min 4.1ms
123123

124124
// second try
125125
write4bits(0x03);
126-
delayMicroseconds(4500); // wait min 4.1ms
126+
delayMicroseconds(4400); // wait min 4.1ms
127127

128128
// third go!
129129
write4bits(0x03);
130-
delayMicroseconds(150);
130+
delayMicroseconds(150); // wait min 100μs
131131

132132
// finally, set to 4-bit interface
133133
write4bits(0x02);
@@ -137,11 +137,11 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
137137

138138
// Send function set command sequence
139139
command(LCD_FUNCTIONSET | _displayfunction);
140-
delayMicroseconds(4500); // wait more than 4.1 ms
140+
delayMicroseconds(4400); // wait min 4.1ms
141141

142142
// second try
143143
command(LCD_FUNCTIONSET | _displayfunction);
144-
delayMicroseconds(150);
144+
delayMicroseconds(150); // wait min 100μs
145145

146146
// third go
147147
command(LCD_FUNCTIONSET | _displayfunction);
@@ -176,13 +176,13 @@ void LiquidCrystal::setRowOffsets(int row0, int row1, int row2, int row3)
176176
void LiquidCrystal::clear()
177177
{
178178
command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero
179-
delayMicroseconds(2000); // this command takes a long time!
179+
delayMicroseconds(1800); // wait min 1.52ms
180180
}
181181

182182
void LiquidCrystal::home()
183183
{
184184
command(LCD_RETURNHOME); // set cursor position to zero
185-
delayMicroseconds(2000); // this command takes a long time!
185+
delayMicroseconds(1800); // wait min 1.52ms
186186
}
187187

188188
void LiquidCrystal::setCursor(uint8_t col, uint8_t row)

0 commit comments

Comments
 (0)