MOVE CURSOR BACK causes linefeed after 20 uses
Posted: Sat Jul 19, 2008 2:01 pm
I have an LK202-25 2X20 display, version 5.7. I am using the serial port connected to a PIC board I designed. If the display is cleared first, the following code should display a character in the upper left corner, move back and overwrite it, repeatedy from A-Z. After the 20th character, however, the display moves to the next line as if I had reached the end of the current line. After the next 20 characters, it scrolls the display up, etc. The position should still be at the beginning because of the "move cursor back" command after each character. It seems that the display doesn't decrement its character position when the "move cursor back" command is given. Can any one explain?
char c;
while(1) {
for(c='A';c<='Z';c++) {
DelayMs(200); /* Delay 200 milliseconds to see what is happening */
lcd_write(c); /* this is a function that sends a char out serial port */
lcd_write(0xFE); /* Send the MOVE CURSOR BACK command */
lcd_write('L');
}
}
char c;
while(1) {
for(c='A';c<='Z';c++) {
DelayMs(200); /* Delay 200 milliseconds to see what is happening */
lcd_write(c); /* this is a function that sends a char out serial port */
lcd_write(0xFE); /* Send the MOVE CURSOR BACK command */
lcd_write('L');
}
}