Pages: [1]   Go Down
Author Topic: 16x1 lcd  (Read 1163 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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:
#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() {
}
« Last Edit: September 21, 2010, 07:05:21 am by dario111cro » Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thx for help, but it's still same. No difference at all. smiley-sad
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

@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
Logged

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

@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
« Last Edit: September 23, 2010, 07:05:46 am by floresta » Logged

Pages: [1]   Go Up
Jump to: