Pages: [1]   Go Down
Author Topic: LiquidCrystal 4x16 lines  (Read 2251 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Using the LiquidCrystal library for a 4x16 lines lcd I discovered that  the characters on line number 2 and 3  where shifted 4 positions to the right.

Checking the source code I found that the line address are not correct.
Original:   int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
It should be:   int row_offsets[] = { 0x00, 0x40, 0x10, 0x50 };

I believe that the original code is for 2x16 or 4x20 lcd's hence the 0x14 and 0x54 addresses.

Perhaps one could add an extra parameter when creating the object
of the LiquidCrystal class stating the number of characters per line so it even works fine for all 8, 16 and 20 characters lcd's.

I even have a 2x40 lcd however did not test it yet.

Logged

Stockholm, Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have also seen that problem. I thought it had something to do with the specifc LCD I have. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1246900100/10#10
Logged

New York, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Howdy. I don't check PMs often, so email me!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post the specific model of LCD you're working with?  I found it worked on the models I have, but I wonder if you've got a non-standard Hitachi knockoff chip or something like that. Not sure if we can make it work for every exception, but it's worth looking into.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 4401
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

tigoe:

This issue has been covered in the three months that have elapsed since the last post to this thread.  Unfortunately I can't come up with the specific posts due to the limitations of the search function of this forum.  This is a known bug (actually an omission) in the LiquidCrystal library and the fixes have already been submitted for inclusion in an upcoming release.

Don
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure.  

There's a bug w/ the RW pin that causes it to get used when it shouldn't be.  That's known.

But the shifting of characters by two places on the third and fourth lines sounds like a different issue, one that I don't know the fix for.  If you have any more details, that would be great.

You might try searching with Google; it seems to do a good job of indexing the forum posts.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 4401
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

mellis:

The shifting or offset of characters on lines 3 and 4 of the 16x4 displays comes about because that display has different starting addresses for lines 3 and 4 than the 20x4 for which the library is written.

I found one of the previous threads about this topic using Google as you suggested.  Here's the link: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1253367247/6

Don
Logged

Pages: [1]   Go Up
Jump to: