diff --git a/lcd/lcd_api.py b/lcd/lcd_api.py index 38b60da..f939152 100644 --- a/lcd/lcd_api.py +++ b/lcd/lcd_api.py @@ -127,8 +127,10 @@ def move_to(self, cursor_x, cursor_y): addr = cursor_x & 0x3f if cursor_y & 1: addr += 0x40 # Lines 1 & 3 add 0x40 - if cursor_y & 2: - addr += 0x14 # Lines 2 & 3 add 0x14 + if cursor_y & 2 and self.num_columns == 16: + addr += 0x10 # Lines 3 & 4 add 0x10 for 16 cols and 0x14 for 20 cols + if cursor_y & 2 and self.num_columns == 20: + addr += 0x14 self.hal_write_command(self.LCD_DDRAM | addr) def putchar(self, char):