LCD long sentence scrolling

Status
Not open for further replies.

AGCB

Member
I'm trying to figure how to scroll a long sentence on one line of a 2x16 LCD similar to this link

**broken link removed**

I was able to break the string into smaller parts and do it but there must be an easier way.
Thanks. Aaron
 
easy... make a loop

For instance...

Code:
while(*string)
{
    LCD_String(string);

    for(x=0;x<SpaceCount;x++)
    {
        LCDChar(" ");
    }

    String++; 
    SpaceCount++;
}

Something like that
 
I didn't understand that C code from Jason, What part of the program needs to be looped. I would like a smooth scrolling sentence on one line. Is this possible?
 
Ok... Its like this...

You need 1 VARIABLE to keep count of the length of the string...
You need 1 VARIABLE to keep current position in string

You make 1 MAIN loop

In the main loop:
send the string starting from position variable to the length
loop sending spaces ... using position as the count
then increment position variable and repeat until position == length
 
Take a look at Nigel's scrolling technique in the tutorials... The scrolling is done through a 8x8 matrix but the code is the same... I think its tutorial 11
 
I would like a smooth scrolling sentence on one line. Is this possible?

You can't smooth scroll a text LCD, only character scrolling is possible. (Unless it's a 2*8 and then you can but it's complicated)

Mike.
 
You can't smooth scroll a text LCD, only character scrolling is possible. (Unless it's a 2*8 and then you can but it's complicated)

Mike.

Is that because of the 40 character per line limit? I.E w/o jumping to the other line.

I've done it by breaking the message into less than 40 character sections, including the beginning position indent, and then calling each section one after the other. There is a slightly longer space between characters while the display is cleared and reset but it is not too objectionable. It may be possible to limit that longer space w/ more code but I'm satisfied at this point.

Thanks for all the posts! Aaron
 
Is that because of the 40 character per line limit? I.E w/o jumping to the other line.
I think he is defining 'smooth-scrolling' as scrolling a single pixel at a time - this means you'd need to use all eight of the CGRAM custom characters. The video you is just scrolling a character at a time, so it's not difficult.

I can't remember, but I thought that if you use the entry-mode-set command and specify that the display should shift after every write, you'd just have to write each character of your long string to the same position for the display to scroll.
 
I've tried a lot of things but apart from breaking the string into less than 40 characters, it jumps to the other line and sometimes both lines at once out of phase so to speak and then stars over on the same line but does not finnish.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…