22 March 2022

Again problems with LiquidCrystal_I2C Arduino library

I am having issues again with third party Arduino code that uses the LiquidCrystal_I2C library. The code was written in 2015-2017 and since then the said library has been hijacked, abandoned and is not backward compatible. In other words: it doesn't work. But I mostly do not like the "hijack and abandon" part.

The second part of the problem is using a mjkdz I2C adapter that reacts on address 0x20 but has a different wiring to the display, let alone the IC part number scratched off. This adapter needs a flexible library that allows remapping the PCF8574x outputs, which is not the case for most common LiquidCrystal_I2C. Or custom code and direct I2C drive. No thanks.

Conclusions of few hours spent debugging this stuff are:

  • throw away mjkdz modules so I don't fall again in the same mistake few months from now;
  • use LiquidCrystal_PCF8574 to avoid ambiguities and LiquidCrystal_I2C hijacked libraries: they are 95% compatible (just chance the instantiation and call to begin method)