20x4 LCD I2CexpDiag issue

Like other posts, I have experienced an issue with cursor addressing on the 20x4 lcd display.

Using these libraries:

#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header

I loaded the I2CexpDiag test code and tried changing the row and column addressing in the Uptime display. Row and column addressing behaved badly with lines in the wrong place.

I have managed finally to get this working. In the I2CexpDiag code, I discovered that in this line (394):

if((status = lcd[NumLcd].begin(LCD_ROWS, LCD_COLS)) != 0)

should actually be set to:

if((status = lcd[NumLcd].begin(LCD_COLS, LCD_ROWS)) != 0)

I thought this might help, but comments would be welcome.

@bperrybap would be the right one to comment, as he is the developer for this library.

OK thanks. I am new to this forum. but I am sure @bperrybap will see this post.

@timbanjo
Yes you are correct,
the begin() parameters order you pointed out in I2CexpDiag is an issue.
I actually fixed it in the code Nov 17, 2021.
I'm quite behind in getting a new release out.
Lots of personal & family issues have been happening and time has really slipped away.

But even with the bug, it should not affect the diagnostic operation when using the code as it is, even on larger displays like 20x4.

--- bill

Some details on the hd44780 library next release:

I have been planning and working on a 2.0 release for the hd44780 library that will be the next release.
It has lots of updates and some major changes.
It will have this fix in it.
It is a major release that re-structures the library directory structure to try to make the library easier to use, particularly when it comes to the examples.
It should be much more intuitive of how to locate the examples through the IDE.
It will also transition away from local html documentation and move to web based documentation. This wasn't my preference, but after several years I still can't get the 2.x IDE developers to fix the IDE to support handling local html files.
It works with IDE 1.x but not 2.x
So all hd44780 library documentation links provided in the library examples will now link to files on the hd44780 library github repository.

The big challenge has been how to preserve backwards compatibility to ensure no existing code that uses the hd44780 library is broken, and yet move forward with new capabilities.
Capabilities like being able to specify things like i2c WIRE objects so the hd44780 library can easily work with any WIRE API compatible library including supporting being able to select which WIRE library object to use when the core supports multiple i2c busses.

One of the biggest issues is that most of the Arduino IDE cores are using a relative old version of gcc (around 8 years old). The newer versions of gcc support C++ 2017 standard which has some additional c++ template capabilities that I would like to use to extend the classes more transparently, but I can't use these capabilities since I am limited by the older versions of gcc being used.

--- bill

Thanks for the quick response Bill.