Arduino Forum

Forum 2005-2010 (read only) => Software => Troubleshooting => Topic started by: dario111cro on Sep 20, 2010, 02:42 pm

Title: 16x1 lcd
Post by: dario111cro on Sep 20, 2010, 02:42 pm
So, I got my lcd working. But in weird way. It shows only half of text (8 letters). I can show second half if I mark lcd as 16x2 (and it's not!) in code. Then I point cursor to (0, 1) and show next half of letters (8 in same line as before). It's a little bit stupid. Dose all 16x1 lcd work this way or is it bug in lcd or my code?

Show only half of text:
Code: [Select]
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
 lcd.begin(16, 1);
 lcd.print("hello, world!");
}

void loop() {
}




Show full text:
Code: [Select]
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
 lcd.begin(16, 2);
 lcd.print("hello, w");
 lcd.setCursor(0, 1);
 lcd.print("orld!");
}

void loop() {
}
Title: Re: 16x1 lcd
Post by: mowcius on Sep 20, 2010, 03:26 pm
Take a look at the liquidcrystal440 library, it might help.

It is due to how your LCD is set up with the character mapping.

Mowcius
Title: Re: 16x1 lcd
Post by: dario111cro on Sep 20, 2010, 03:45 pm
Thx for help, but it's still same. No difference at all. :(
Title: Re: 16x1 lcd
Post by: mowcius on Sep 20, 2010, 09:22 pm
well if our resident LCD expert sees this then he might be able to suggest some library changes but other than that I don't know what to suggest. You just have a weird LCD!

Mowcius
Title: Re: 16x1 lcd
Post by: Palle B on Sep 21, 2010, 11:49 am
MY 16X4 LCD had the same issue, on the bottom 2 rows, but the top 2 rows where fine?

I dont know whats causing this, but i came over it by indexing the startpoint.
Instead of   lcd.setCursor(0, 2); i wrote:   lcd.setCursor(-4, 2); that did the trick.

I know that it's not the right way, but it works.
Title: Re: 16x1 lcd
Post by: dario111cro on Sep 22, 2010, 08:22 pm
Can someone write me custom function to split txt in two 8 digit variables? I will be very thankful.
Title: Re: 16x1 lcd
Post by: floresta on Sep 23, 2010, 01:46 pm
@dario111cro
Quote
So, I got my lcd working. But in weird way. It shows only half of text (8 letters).

@mowcius
Quote
You just have a weird LCD!
This behavior is quite normal (in a weird sort of way).  Most 16x1 displays are actually internally configured as 8x2.   Follow the LCD Addressing link at http://web.alfredstate.edu/weimandn for an explanation.


Don
Title: Re: 16x1 lcd
Post by: floresta on Sep 23, 2010, 01:52 pm
@Palle B
Quote
MY 16X4 LCD had the same issue, on the bottom 2 rows, but the top 2 rows where fine?
This is an entirely different problem which is due to the incompleteness of the LiquidCrystal library.  In it's current form the library does not use all of the information in the lcd.begin() argument and does not correct the starting address for lines 3 and 4 of the 16x4 displays.  Follow the link in reply #6 for the explanation.  I believe that John has fixed this in LiquidCrystal440.

@Palle B
Quote
Instead of   lcd.setCursor(0, 2); i wrote:   lcd.setCursor(-4, 2); that did the trick.

I know that it's not the right way, but it works.
That's the easiest solution.  Just make sure you comment your sketch so you will remember why it doesn't work if they ever fix LiquidCrystal.  

Of course they will have to admit that there is a problem first, which isn't likely.  Check this out: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1248809589.

Don