a tutorial i have made for connecting the I2C LCD, you will find two videos on my channel using different sensors with the LCD. Hopefully this helps, as i and others have had problems when firsting wiring and coding the LCD.
The biggest people problem have with i2c based backpacks for their LCDs is s/w.
There are many libraries out there that all have a LiquidCrystal_I2C.h header file and LiquidCrystal_I2C class.
They are different in how they installed, how they work, how they initialize the s/w & h/w, and their APIs.
On top of that, not all backpacks wire the PCF8574 chip up the same way to the LCD, so many of these libraries only work on certain backpacks.
A few allow the sketch to configure the library as to how the PCF8574 is wired up to the LCD.
And that is the biggest problem for users. It is very difficult for many users to figure out which one they have.
And if they do know which library they have, many are unable to fill in the constructor parameters with the proper information to make it work. Many struggle with something as simple as getting the I2C address correct.
And most don't know how to examine the backpack to figure out the pin mapping for those libraries that require entering it into the constructor.
As result, many users really struggle getting their backpacks to work when using a "LiquidCrystal_I2C" library.
There is a LiquidCrystal_I2C library that is available in the IDE library manager.
However that one just like most others is hard coded for a particular backpack (which make things simpler), but doesn't work with some of the backpacks out there.
The LiquidCrystal_I2C used in the video tutorial is yet another library calling it self "LiquidCrystal_I2C".
It is not the same LiquidCrystal_I2C library that is in the library manager.
It also initializes using different a different API function than the one in the library manager.
And just like the one in the IDE library manager the one referenced in the video hard codes the pin mappings so it will only work if the backpack being used matches the pin mappings in the library.
So now you can see the issue that people have with the LiquidCrystal_I2C library.
To help make things easier, I created a hd44780 LCD library package.
I believe that it simplifies things quite a bit for i2c based LCD backpacks.
It can quickly and easily be installed using the IDE library manager directly from the IDE GUI.
It can auto detect the i2c address.
It can also auto detect the PCF8574 to LCD pin mappings and LCD backlight control so that it works on any backpack.
You can read more about it here: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library
The i/o class for i2c based backpacks is hd44780_I2Cexp.
The library includes several examples which demonstrate how to use the library in sketches.
I would recommend first running the included diagnostic sketch I2CexpDiag which will verify that library is working correctly with the backpack. It will first test the i2c signals and then test the RAM inside the LCD module. It can test multiple backpacks at once if you have more than one with different i2c addresses.
--- bill
Hi,
All sounds good but the link don't work??
Regards
Mel.
The link itself was actually correct: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library
Somehow the forum generated some corrupt html code for the link in the post.
I have modified/updated the previous post as well to correct it.
--- bill