LiquidCrystal 16x4 error

I found that with HD4478xx LCD with more than 2 lines the line 3 and 4 are displayed incorrectly. void LiquidCrystal::setCursor(uint8_t col, uint8_t row) seems to display (0,3) at (4,3) for some reason so I changed the Library to display correctly those rows. At the function void LiquidCrystal::setCursor(uint8_t col, uint8_t row) just add " if ( row > 1 ) { col = col-4;} " before the "command(LCD_SETDDRAMADDR | (col + row_offsets[row]));".
Is there anyone that complains of the same behaviour or is it just me and my LCDs 16x4????
Thanks

IIRC, a 16x4 LCD is the same as 2 "interleaved" 16x2 displays; the "first display" is lines 1 and 3, the second display is lines 2 and 4...?

I think.

:-?

have you tried using the liquidcrystal440 library? New updated library which is better for 20x4 and I think stuff has been improved for the 16x4 as well.

Mowcius

BlackPhoenixPT:

You have rediscovered one of the few flaws in the new LiquidCrystal library that was introduced with v0017. The library currently treats all multi-row displays identically and does not account for the fact that the first address for rows 3 and 4 differs between the 20x4 and the 16x4 displays.

Check out:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1253367247/6

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1248809589

For information about LCD addressing check out the LCD Addressing link at http://web.alfredstate.edu/weimandn.

Don

Does anyone have a patch for this? If so, can you post it in the Google Code issues list: Google Code Archive - Long-term storage for Google Code Project Hosting.?

Does anyone have a patch for this?

Dave:

I believe that John Raines could whip one up fairly easily since he fixed the problem in his recent "Enhanced LiquidCrystal" library (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1264823411/all).

He will probably see this thread but I will send him an Email to make sure.

Don

LiquidCrystal440 fixes that bug, a bug that appears if you scroll the display and then setCursor and also fixed a timing issue that I had with one LCD needing a little longer startup delay than is in the standard LiquidCrystal routine. The 4 data pin version is about 30% faster than the standard routine as well, because the standard routine has an unneeded delay between data nibbles. You can download it at http://healthriskappraisal.org/LiquidCrystal440.zip

If there is a need for a version that doesn't fix one of those bugs or doesn't support the 4x40 LCD displays, I can come up with a separate version, but its not obvious to me why one would want that.

John:

I think they are trying to keep the official LiquidCrystal relatively simple so they don't want a complete rewrite with a lot of new features. What they do want to do is to fix what is already there.

It is my opinion that a major improvement would be to set the default configuration for a 16x2 rather than the current 16x1. Almost every display out there would function adequately with this configuration. The only exceptions that I can think of are the aforementioned 16x4 display and some 16x1 displays (most are actually 8x2 internally). I believe this can be done by changing exactly 1 byte of code.

Don