Pages: [1]   Go Down
Author Topic: 40x4 + LiquidCrystal440 missing character  (Read 845 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, I just received my Arduino Uno today in the mail. I decided my first project would be getting an old 40x4 LCD running.
I'm new to this, so I'm sorry if this is a nooby question.

So after a lot of searching i worked out how to wire it up, and get it working with the LiquidCrystal440 libraries.
It works great except the coordinate (0,0) does not display on the screen

Eg.
Using the following code;
Code:
LiquidCrystal lcd(12, 10, 11, 13, 5, 4, 3, 2);

void setup() {
  lcd.begin(40, 4);
    lcd.setCursor(0, 0);
  lcd.print("hello, world!");
    lcd.setCursor(0, 1);
  lcd.print("hello, world!");
    lcd.setCursor(0, 2);
  lcd.print("hello, world!");
    lcd.setCursor(0, 3);
  lcd.print("hello, world!");
}

void loop() {
}

The screen outputs :
Quote
ello, world!
hello, world!
hello, world!
hello, world!

Also the last character of the first line (40,0) does not display
So it appears of the whole top line has shifted to the left one column

Anyone know what the deal is?
Thanks

[Edit]
Even if i lcd.setCursor(10, 0) before the first print, i get the same "ello" , same position
« Last Edit: November 09, 2011, 05:24:04 am by MarcelG » Logged

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

It's more likely to be a problem with your LCD than with the library.  I typically have people try printing 80 characters to the screen using the following sketch.  You will have to modify it if you want to check out the lower two lines on your 160 character display.  To do this you have to run the 'for' loop twice in order to always use the 80 displayable ASCII characters from 47 to 127.

...
void setup()
  {
    lcd.begin(20, 4);
    for (int i=47; i<127; i++)                 // send 80 consecutive displayable characters to the LCD
    {
    lcd.print(i,BYTE);
    delay(100);                                // this delay allows you to observe the addressing sequence
    }
  }
void loop()
  { 
  }


Don
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

I only have one of these displays but every version of the software I have posted has been run through test code that puts characters in all 4 corners at several points in the code. I test that in because I wanted to demonstrate/test that I had fixed the way the standard liquidCrystal behaves if you scroll the display and then setCursor. It puts characters in all 4 corners before scrolling a random number of times and then again after scrolling. It does ithis for both left and right scrolling directions.

Certainly the software has been thoroughly tested at all 4 corners of each of the sizes of display I have (40,4; 20,4; 16,4;16,2) except the 16,1 = 8,2. My test program overwrites some of the 'corners' that would be in the middle of the screen before it pauses to give me a look in the corner tests for that goofy display and I never bothered to fix the test code to handle that case better.

If Don thinks it may be a defect in your display, I would tend to agree.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I see,
Its quite bazaar behavior. It only happens with the first lcd.print() of any script, It prints on the first line, missing the first character  (regardless of any prior lcd.setCursor())
But after that the commands work fine, so i can work around that quite easily.
Thanks
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, this will fix your problem:
There is some initialization delay too short for some LCDs. Just put in your own delay right before the first write. I use delay(1000); (one second) but haven't tried any lower.
Logged

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

First of all this thread has been dead for over two years.

Secondly you should do some more research into LCD440 before you suggest kludging up the program.  John worked with all of the delays and made sure that the program worked with the worst (slowest) display he could find.  More delays will not fix a defective display.


Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Floresty, I am happy to revive an old thread to post a solution. I was looking for an answer to the same question, and when I solved it it was natural for me to update this thread (which I found by googling) so other people that also find it will have a solution, not just a question. How would you go about helping others that in the future will find this thread to no avail?

If "John"
Quote
made sure that the program worked with the worst (slowest) display he could find
how can you be so sure he had one as slow as mine/ours? You've told me off twice in one post, but have not offered a better solution for any of the problems you state.
Logged

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

Quote
how can you be so sure he had one as slow as mine/ours?
Because I worked with John when he developed that program.  If you read his program notes you will see that he mentions my name specifically.  If your device is slower than his then it is way, way out of spec.  He specifically purchased and as I recall also solicited the loan of sub-standard displays to test the program.

Quote
You've told me off twice in one post, but have not offered a better solution for any of the problems you state.
I was not 'telling you off' when I pointed out basic forum etiquette.  Many forums close threads after a month or two of inactivity.

If you look through the 'Displays' section of the forum you will find dozens if not hundreds of cases where I have provided better solutions for the problems.  If you use the QR code at the left, or use your browser to go directly to the website that I frequently mention in my posts (web.alfredstate.edu/weimandn) you will find detailed descriptions of how to properly initialize a character mode LCD along with more than a dozen completely commented LCD programs written for the Arduino without using a library, in regular C, and in assembly language.


Don
« Last Edit: February 12, 2014, 11:00:35 am by floresta » Logged

Pages: [1]   Go Up
Jump to: