issues with LiquidCrystal_I2C library

Hello

A couple of years ago I built a MIDI controller which used an LCD for selecting the various controller modes. The controller was working fine and the code I wrote was compiling without problem. Recently I decided to make some changes, pulled out the old working code but it won't compile anymore.
Now, I believe I have installed the required libraries but I keep getting error messages like the ones below:

#pragma message: LiquidMenu: Configured for Parallel. Edit 'LiquidMenu_config.h' file to change it
#pragma message: LiquidMenu: Selected 'LiquidCrystal' (parallel) library. Edit 'LiquidMenu_config.h' file to change it.

these are the library I am using in the code:
Encoder.h; Wire.h; Adafruit_Trellis.hl; Adafruit_UNTZtrument.h; LiquidCrystal_I2C.h; LiquidMenu.h; avr/pgmspace.h; MIDIUSB.h.

It appears that the problem is caused by the LiquidCrystal_I2C and liquidmenu libraries.
I have searched on the forum and found that there are many different LiquidCrystal_I2C libraries using the same name but with different functions (so that may well be the problem here). I checked my library folder to make sure that I was not using the wrong one. In there I found that at the time I was coding, I had Newliquidcrystal_1.3.5 and LiquidCrystal_I2C-1.1.2. I tried both with no success. It's very annoying because the original code was compiling and working. I even tried to install the IDE version I was using at the time 1.8.7 but it makes no difference. Any suggestion?

just to be a bit more precise with a few examples

with LiquidCrystal_I2C-1.1.2 installed the program stops at this line:

LiquidCrystal_I2C  lcd (I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin);

and produces this error:
#pragma message: LiquidMenu: Selected 'LiquidCrystal' (parallel) library. Edit 'LiquidMenu_config.h' file to change it

with Newliquidcrystal_1.3.5 installed the program stops at this line (which is a bit further down the line below):
LiquidMenu menu (lcd); (producing the same error)

I suggest that you forget about the LiquidCrystal_I2C libraries. One problem is that there are several libraries by that name and they are not, necessarily, compatible. If you try to compile an example and it is not written for the particular library, all sorts of strange errors happen. There is a newer and better library for I2C LCDs. It is the hd44780 library by Bill Perry. It is a current and well maintained library. It uses the same API as the older libraries so you don't have to change much. See the examples included with the library.

For an I2C LCD display to work, the I2C address and the I2C backpack to LCD pin mapping must be correct. If the library default settings for either or both are not correct the LCD will not work. You can try to figure out the right pin mapping and use an I2C scanner to find the address, but if you install and use the hd44780 library that is done automatically by the library.

Install the hd44780 library. The hd44780 library is the best available for I2C LCDs. The library is available in the Library Manager. Go to Library Manager (in the IDE menus, Sketch, Include Libraries, Manage Libraries) and in the Topics dropdown choose Display and in the Filter your search box enter hd44780. Select and install the hd44780 library by Bill Perry.

The class that you want to use is the hd44780_I2Cexp class. There are examples to show how to use the library. The nice thing about the hd44780 library is that it will autodetect the I2C address and the I2C backpack to LCD pin mapping.

In the examples, there is a diagnostic sketch that will help us to help you if you still have trouble with the display. Run the diagnostic sketch and post the results.

Have you edited the LiquidMenu_config.h file in the library folder to indicate you are using the LiquidCrystal_I2C library instead of the LiquidCrystal library? Would really have been better if the author of the library had put the options in the constructor instead of using a config file.

Thank you very much to both of you! Good to know that there is an alternative and better library for LCD. I will use it in future if working with LCD displays.

AND YES .... that was the problem...

david_2018:
Have you edited the LiquidMenu_config.h file in the library folder to indicate you are using the LiquidCrystal_I2C library instead of the LiquidCrystal library? Would really have been better if the author of the library had put the options in the constructor instead of using a config file.

I did not think about editing the library config file (even though it was clearly written in the error message!!) because I did not remember editing any library before (but I must have done at the time)! I have now edited it and it compiles.

very very grateful ! :slight_smile: