Pages: [1]   Go Down
Author Topic: LCD only displaying part of the text (first 8 chr)  (Read 1175 times)
0 Members and 1 Guest are viewing this topic.
Bundesrepublik Deutschland
Offline Offline
Newbie
*
Karma: 0
Posts: 38
[no personal text]
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is a continuation (with no reference to) my old post, which I have resolved (mostly) however I have a strange problem that won't go away.
Sorry, I tried to delete my previous message, but it didn't work as I intended. smiley-cry

firstly, this LCD is the hitachi driven one, and is 16x1
This means it should display 16 character messages with ease, right?

The code to display the text is lcd.print("Hello, World!");
It half works. on the LCD I have "Hello, W", it's missing the "orld!" part.

I am just confused as to why it's wrong like that?
The code that fixes it (and is burtally inefficient is:
Code:
void setup() {
  // set up the LCD's number of rows and columns:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, w");
  lcd.setCursor(0, 1);
  lcd.print("orld!");
}

anyone know what I am doing wrong?
Why must I setCursor to elsewhere when I haven't even exceeded my  16 character limit
Logged

Lancashire, UK
Offline Offline
Edison Member
*
Karma: 9
Posts: 1991
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What happens if you tell it has a 1 line display rather than the 2 lines in the sketch ?

Code:
lcd.begin(16, 1);
Logged


Bundesrepublik Deutschland
Offline Offline
Newbie
*
Karma: 0
Posts: 38
[no personal text]
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahh, I thought of that too.

when happens when I do that is the contrast jumps up extremely high (it was fine when I had the 16,2) and the first 8 "blocks" (where the letters are) are the ONLY ones that turn black, but still the same thing, only the first 8 characters displayed (faintly due to the contrast).
Logged

Lancashire, UK
Offline Offline
Edison Member
*
Karma: 9
Posts: 1991
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What if you adjust the contrast so its clear when set to 1 line ?
Logged


Bundesrepublik Deutschland
Offline Offline
Newbie
*
Karma: 0
Posts: 38
[no personal text]
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still the same. Only the first 8 characters are displayed. It's almost as this display is 2 lines of 8 characters each arranged in a horizontal position.
 _ _ _ _ _ _ _ _    _ _ _ _ _ _ _ _
|_ _ _ _ _ _ _ _ | _ _ _ _ _ _ _ _|
  DISPLAY 1 ^       DISPLAY 2 ^

Above is what I mean.
Logged

Lancashire, UK
Offline Offline
Edison Member
*
Karma: 9
Posts: 1991
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like an oddball LCD that doesn't quite get on with the arduino and/or it's library.  There are a huge number of different displays made by umpteen different manufacturers over a period of several decades, they don't all work as they should with the arduino.  

There are several libraries other than the standard liquidcrystal, have you tried any of them ?  

This is one :

http://www.arduino.cc/playground/Code/LCD4BitLibrary
Logged


Bundesrepublik Deutschland
Offline Offline
Newbie
*
Karma: 0
Posts: 38
[no personal text]
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure if this will help you at all, but here is what my LCD looks like and the picture of the display showing 8 characters:


http://img34.imageshack.us/i/picture16sm.jpg/

http://img28.imageshack.us/i/picture13p.jpg/

I will post more alter, but I have to go to work now.
Thanks!
« Last Edit: June 12, 2010, 01:30:00 pm by xaxisy » Logged

Minnesota USA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Made it mahself outta sand 'n wahr.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

many, perhaps most 16x1 displays are better described as 8x2 displays.

see:http://web.alfredstate.edu/weimandn/lcd/lcd_addressing/lcd_addressing_index.html

Logged

Minnesota USA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Made it mahself outta sand 'n wahr.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

if you use this version of the LiquidCrystal library and an lcd.begin(8,2) statement it will wrap "line1" onto "line 2" so that all 16 characters show up on one line.

http://healthriskappraisal.org/LiquidCrystal440.zip
Logged

Bundesrepublik Deutschland
Offline Offline
Newbie
*
Karma: 0
Posts: 38
[no personal text]
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for a newbie question, but how would I make that into a library?
Many thanks!
Logged

Minnesota USA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Made it mahself outta sand 'n wahr.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

there is probably good description somewhere on the site.

what I do on my Mac is to navigate to a folder inside the Arduino application:
Arduino.app/Contents/Resources/Java/libraries
That folder holds libraries. in this case you add the downloaded folder LiquidCrystal440.

in your sketch, instead of #include <LiquidCrystal.h> write #include <LiquidCrystal440.h> from then on it is identical syntax
LiquidCrystal lcd(rs,rw,en,d0,d1,d2,d3) etc.

Logged

Bundesrepublik Deutschland
Offline Offline
Newbie
*
Karma: 0
Posts: 38
[no personal text]
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you! That's wonderful!
The LCD440 code worked like a charm.

Logged

Pages: [1]   Go Up
Jump to: