i have a problem with displaying a long text (larger than 20 character),the problem is the text is displayed on two row not one(the first line and the third).
i want this long text to be displayed on one line and scrolling.
the code is
Try this (untested):
(1) Move the autoscroll command into setup, there's no need to execute it each time around the loop.
(2) Set your cursor to the end of the line, not the beginning.
floresta:
Try this (untested):
(1) Move the autoscroll command into setup, there's no need to execute it each time around the loop.
(2) Set your cursor to the end of the line, not the beginning.
Riva:
I cannot remember where I saw it or if it's fixed now but I recall reading that the LiquidCrystal library does not work properly with 20x4 displays.
Riva:
I cannot remember where I saw it or if it's fixed now but I recall reading that the LiquidCrystal library does not work properly with 20x4 displays.
that is a bad news
No problem, it's not true and has never been true. Did you read reply #7.
it display the text in two lines (1 and 3) and scrolling it.
That's really not very descriptive.
Where does the first character appear?
What happens when the second character is sent?
What happens after the 20th character is sent?
It is probably working properly, it's just not what you expect or want.
You need to know how the addressing works in order to understand what is happening. Try following the LCD Addressing link at http://web.alfredstate.edu/weimandn. Make sure you read the information about the 40x2 before looking at the 20x4 information.
it display the text in two lines (1 and 3) and scrolling it.
That's really not very descriptive.
Where does the first character appear?
What happens when the second character is sent?
What happens after the 20th character is sent?
It is probably working properly, it's just not what you expect or want.
You need to know how the addressing works in order to understand what is happening. Try following the LCD Addressing link at http://web.alfredstate.edu/weimandn. Make sure you read the information about the 40x2 before looking at the 20x4 information.
Don
Thank you very much
now i can understand how it's addressed
it will need a much work to work as I want
Rather than just helping yourself it would be interesting if the issue could be documented and be available on the forum for other members with similar issues.
A (huge) static picture does not help in a case like this. In order to determine if there is a problem we need the answers to the questions in reply #11.
We also need to see the code that is being used after incorporating the suggestions in reply #2..
I am seeing the exact same issue, and was going to create my own post when I saw this.
I have a sainsmart 2004 20x4 I2c lcd. I am using the FM liquid crystal library, and am seeing the same behavior.
I think it is related to the LCD addressing link, but I would have thought the lcd library would handle that.
Here is my code:
simnick:
I am seeing the exact same issue, and was going to create my own post when I saw this.
I have a sainsmart 2004 20x4 I2c lcd. I am using the FM liquid crystal library, and am seeing the same behavior.
I think it is related to the LCD addressing link, but I would have thought the lcd library would handle that.
Here is my code:
void setup()
{
lcd.begin (20,4);
lcd.home (); // go home
lcd.print("This is 26 characters long");
}
void loop() {
}
And the output looks like:
This is 26 character
s long
Is there some initialization trick, or do I have to write a bunch of string processing code myself to deal with strings > 20?
The sketch you gave simply prints 26 characters on the LCD. You need to tell it to scroll, otherwise anything above what the LCD supports will either not be shown or placed on the next line.