| ??? 07/11/02 04:47 Read: times |
#25656 - RE: Scrolling LCD in vertical direction |
Gopal said:
" Now if am in say 8th screen, how do i know the characters in the previous screens, i.e. the 7th or 6th screens. Ok, if i don't use the n formatting, no problem, i have fixed 32 characters per screen so i've to go 64 characters back and i get the previous screen. Hope u got it. " To make things easier, use a fixed lenght of 32 characters, and use a byte with the meaning of "end of line". you can use the byte #00h, for e.g., since it's a character that you use in your messages. This way each line can have 31 letters, the 32nd letter is reserved to #00h, this way you don't have to fill smaller phrases with spaces neither do you have to worry about the lenght of the phrase, since you know that a phrase is over when you find a #00h character, so you can go to "nth" line adding or subtracting "n" times from your INITIAL position in the actual phrase. E.g. you are at the 8th line , so you start position was 7*32=214 (7, since your first line is 0). You need to go back 2 lines? 214-32-32=160, from here you need to advance to the 9th line? 160+32+32+32=256... you went back and forward and in any moment you have worried about the lenght of any phrase. If you don't like this way and want to use variable lenghts to store your phrases, finnish each phrase with a #00h and if you want to go forward or backwards count the #00's, but to do this you'll have to decrement one character a time... it's slower, but if you are using few phrases, it doesn't matter HTH orlando |
| Topic | Author | Date |
| Scrolling LCD in vertical direction | 01/01/70 00:00 | |
| RE: Scrolling LCD in vertical direction | 01/01/70 00:00 | |
| RE: Scrolling LCD in vertical direction | 01/01/70 00:00 | |
| RE: Scrolling LCD in vertical direction | 01/01/70 00:00 | |
| RE: Scrolling LCD in vertical direction | 01/01/70 00:00 | |
| RE: Scrolling LCD in vertical direction | 01/01/70 00:00 | |
| RE: Scrolling LCD in vertical direction | 01/01/70 00:00 | |
RE: Scrolling LCD in vertical direction | 01/01/70 00:00 |



