View previous topic :: View next topic |
Author |
Message |
Guest
|
Flex_lcd question..... |
Posted: Fri Apr 25, 2008 2:37 pm |
|
|
Hi,
I'm using the flex_lcd4x20.c driver in a project. I'd like to be able to 'scroll' the display up when I reach the end of the last line. To do this, I envision reading the characters of line 2 and writing them to line 1, reading the characters of line 3 and writing them to line 2, etc., etc. To do this, I need a function that can read the current value of each character on a line. I see that there is a function called lcd_read_byte in the driver, but it doesn't have an address argument, so I'm not sure what value it actually returns when it's used?
Dave |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 25, 2008 2:47 pm |
|
|
You could use the lcd_getc() function to do this. But why read the LCD ?
That's very time-consuming. Instead, keep the lcd text data in a
2-dimensional array in the PIC. Then to scroll the LCD, start writing
to the LCD from the next line down in the array. |
|
|
Guest
|
|
Posted: Fri Apr 25, 2008 3:30 pm |
|
|
Hi PCM,
I thought about doing that but I'm not sure if I have the available RAM. I'll have to check.
I'm confused, why a 2 dimensinal array? I was thinking of something like this to hold the data for lines 2 to 4:
Code: |
int8 CharData[19] [2];
|
Dave |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Guest
|
|
Posted: Fri Apr 25, 2008 7:20 pm |
|
|
PCM,
Errr, yes, of course it is! Sorry, just a brain freeze on my part. I honestly don't know what I was thinking :-)!
Dave |
|
|
|