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

LCD Row Update

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








LCD Row Update
PostPosted: Mon Dec 03, 2007 1:37 pm     Reply with quote

Hello everybody,
How can I update one of the two row in LCD Screen in an independant way from other row ?
For example,
first row display, hello,
And then, I count something and display it on the second row by updating regularly.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 03, 2007 1:41 pm     Reply with quote

Use the lcd_gotoxy() function to set the cursor position of the LCD,
before you write text to it.
Here is the description of that function from the CCS LCD.c file:
Quote:
// lcd_gotoxy(x,y) -- Set write position on LCD (upper left is 1,1)

So to set the cursor at the start of line 2, you would use:
Code:
lcd_gotoxy(1, 2);
Guest








PostPosted: Mon Dec 03, 2007 1:46 pm     Reply with quote

Thanks for the reply.
But, if I attempt to change the position of x and y in each ten seconds, do I just need to adjust the new position with this method ?
Or, do I have to first clean the line and then put the new positioned value ?
the reason of asking is that I am going to put number from 0 to 999 by starting from the end of the LCD line (right side of the LCD line)
So, if number is less than 10, or bigger than 9 and less than 100, or bigger then 99 and less than 1000. As you see, I should update the position while doing this. So, do you think that is it enough to just change the position for this operation ? Or do I have to do anything else too ?
Guest








PostPosted: Mon Dec 03, 2007 2:46 pm     Reply with quote

Any suggestions ?
Andreas



Joined: 25 Oct 2004
Posts: 136

View user's profile Send private message

PostPosted: Tue Dec 04, 2007 1:44 am     Reply with quote

there are mainly two solutions to it

1. Just make a format of the string you want to display so it will also output 4 Characters with leading zeros or leading spaces

2. Send out a space string prior to sending the value which will clear the character positions then send the new value out.

But if You want to have always right justified, first solutin will be better

best regards

Andreas
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