View previous topic :: View next topic |
Author |
Message |
Guest
|
LCD Row Update |
Posted: Mon Dec 03, 2007 1:37 pm |
|
|
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
|
|
Posted: Mon Dec 03, 2007 1:41 pm |
|
|
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:
|
|
|
Guest
|
|
Posted: Mon Dec 03, 2007 1:46 pm |
|
|
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
|
|
Posted: Mon Dec 03, 2007 2:46 pm |
|
|
Any suggestions ? |
|
|
Andreas
Joined: 25 Oct 2004 Posts: 136
|
|
Posted: Tue Dec 04, 2007 1:44 am |
|
|
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 |
|
|
|