CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Scrolling characters on an lcd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
edhaslam



Joined: 15 Jul 2005
Posts: 89
Location: UK

View user's profile Send private message

Scrolling characters on an lcd
PostPosted: Fri Oct 07, 2005 3:14 am     Reply with 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. 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

View user's profile Send private message Send e-mail

PostPosted: Fri Oct 07, 2005 6:08 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 07, 2005 7:14 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 07, 2005 11:30 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Oct 08, 2005 5:31 am     Reply with quote

Quote:

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


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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group