You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
init() function for some reason calls begin(16, 1) without any good reason for doing so. init() is normally called from LiquidCrystal constructor and begin() needs to be called from user program before any other code. Current code actually performs double LCD initialization which appears to be harmless but unneeded/time consuming.
This is also raised in issue #11 and issue #41 (currently both open)
It is not harmless because it causes a failure on some platforms.
It is generally incorrect to include, in the constructor, functions which depend on the Arduino run time system being ready, since the object instantiation happens long before that. The unwanted call of begin( 16, 1) has the effect of calling delayMicroseconds() from the constructor and the impact of that depends on the platform. On AVR, delayMicroseconds() falls through immediately if timer0 is not (yet) running so it may appear to work although useless because the timings for the initialisation sequence as specified in the HD44780 data sheet are ignored.
init()
function for some reason callsbegin(16, 1)
without any good reason for doing so.init()
is normally called fromLiquidCrystal
constructor andbegin()
needs to be called from user program before any other code. Current code actually performs double LCD initialization which appears to be harmless but unneeded/time consuming.LiquidCrystal/src/LiquidCrystal.cpp
Lines 70 to 76 in db84824
The text was updated successfully, but these errors were encountered: