#include <PCF8574_I2C_LCD.h>PCF8574_I2C_LCD lcd( (PCF8574_address) 0x3F );
I'm curious . . . in the initialization routine why do you call the first four function set instructions 'attempts'?
It is encouraging to see that you actually followed the data sheet flowchart and turned the display off after the function set and then remembered to turn it back on again after the initialization is complete. Not everyone thinks this two step procedure is necessary but it only takes one extra instruction to do things as recommended.
FLASH size did increase by ~500 bytes for some reason compared to the LiquidCrystal_I2C library the IDE library manager calls up. (Not a big problem though).
Thank you Bill for you explanation. You are absolutely right. I also believe that turning display off is not necessary, but decided to follow the procedure.I haven't seen any build-in LiquidCrystal_I2C library in Arduino IDE. Where is it?
Mmm. Maybe because I added some experimental function. Such as "printHorizontalGraph", "printVerticalGraph", "setBrightness" and "busyFlagCheck" for the future use.
Just to follow up, on the "3 commands" . . .
Small suggestion - the "internal reset / initialization " , I may not be using same term as Hitachi doc does, is really done internally on power up. No software needed for that.
It has its own timing and the result is "all character bits " are on.
So the back-light is important.
Regardless of how the LCD controller interprets what is happening the program code should be issuing what is essentially three initial 'function set' commands. Don't forget that the 4-bit mode was not originally intended to 'save' I/O pins, it was designed to interface with 4-bit microprocessors such as the Intel 4004.My opinion is that, since there is no documentation as to what is actually going on inside the controller, we should not try to figure out what each of the individual steps may or may not be doing. I think we should conceptually group the first three 'function set' instructions together and describe what they are doing as a whole and that is to get the controller into a known state.
While the first the 3 humps of E do get the LCD to a known state of 8 bit mode, it isn't always 3 actual function set commands.
All we have to know is the documented commands.
. . . everything else . . .