Description
The LCD begin()
function makes a call to delayMicroseconds()
passing 50,000 as the delay parameter:
LiquidCrystal/src/LiquidCrystal.cpp
Lines 104 to 107 in 0d02fd8
This exceeds the maximum value of 16,384 according to the delayMicroseconds()
docs.
The 50,000 value will be doubled to 100,000 but because it overflows, the doubling will actually result in 34,464. This will then be doubled to 68,928 and again, overflow to only 3,392 microseconds. The docs for the LCD specify that a delay of 40.1 milliseconds or greater is required, the delayMicroseconds()
function is unable to provide such a delay.
It appears as if the LCD has been properly initialised well before the begin()
function is called. However, I would suggest the following code replace the delayMicroseconds(50000);
call at line 107 in LiquidCrystal.cpp
:
delayMicroseconds(12500);
delayMicroseconds(12500);
delayMicroseconds(12500);
delayMicroseconds(12500);
Which should give the required 50,000 uSecond delay. (Alternatively, use any combination that adds up to 50,000!)