16x1 lcd

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:

#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:

#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() {
}

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

Thx for help, but it's still same. No difference at all. :frowning:

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

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.

Can someone write me custom function to split txt in two 8 digit variables? I will be very thankful.

@dario111cro

So, I got my lcd working. But in weird way. It shows only half of text (8 letters).

@mowcius

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

@Palle B

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

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