View previous topic :: View next topic |
Author |
Message |
edhaslam
Joined: 15 Jul 2005 Posts: 89 Location: UK
|
Scrolling characters on an lcd |
Posted: Fri Oct 07, 2005 3:14 am |
|
|
Does anyone know how to scroll a string of characters from right to left accross an LCD?
I've done a quick search but I can't find any examples in the code section. Just wondered of there were any built-in functions or if anyone had re-written the lcd.c file to do this?
Ed |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Oct 07, 2005 6:08 am |
|
|
No built in functions. It is quite simple though. You can just place the data into a buffer. I function is called at regular intervals that displays the data. Use an index to mark the current starting position. Start at the right most position. After you update the LCD, decrement the pointer. If you reach position 0 on the LCD, then increment a pointer to the buffer. Keep doing this until you reach the end of the buffer and then reset and start again. |
|
|
edhaslam
Joined: 15 Jul 2005 Posts: 89 Location: UK
|
|
Posted: Fri Oct 07, 2005 7:14 am |
|
|
Mark wrote: | No built in functions. It is quite simple though. You can just place the data into a buffer. I function is called at regular intervals that displays the data. Use an index to mark the current starting position. Start at the right most position. After you update the LCD, decrement the pointer. If you reach position 0 on the LCD, then increment a pointer to the buffer. Keep doing this until you reach the end of the buffer and then reset and start again. |
Thanks Mark, I'll try that.
Ed |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Oct 07, 2005 11:30 am |
|
|
Quote: | Does anyone know how to scroll a string of characters from right to left accross an LCD?
I've done a quick search but I can't find any examples in the code section |
The code library didn't exist until fairly recently. You should use the
forum's search engine to search for: LCD scroll
Then you find my old post:
http://www.ccsinfo.com/forum/viewtopic.php?t=20948
Note: That post contains a routine to scroll left. To scroll right,
make a new routine, with that sends 0x1E:
Code: | void lcd_scroll_right(void)
{
lcd_send_byte(0, 0x1E);
} |
|
|
|
edhaslam
Joined: 15 Jul 2005 Posts: 89 Location: UK
|
|
Posted: Sat Oct 08, 2005 5:31 am |
|
|
Yeah, I did I general search but must have missed that post as I was scanning down the list!
Thanks for the code - I'll give it a try.
Ed |
|
|
|