MCPcopy Create free account
hub / github.com/RetiredWizard/PyDOS / move_to

Method move_to

cpython/lib/lcd_api.py:122–133  ·  view source on GitHub ↗

Moves the cursor position to the indicated position. The cursor position is zero based (i.e. cursor_x == 0 indicates first column).

(self, cursor_x, cursor_y)

Source from the content-addressed store, hash-verified

120 self.hal_backlight_off()
121
122 def move_to(self, cursor_x, cursor_y):
123 """Moves the cursor position to the indicated position. The cursor
124 position is zero based (i.e. cursor_x == 0 indicates first column).
125 """
126 self.cursor_x = cursor_x
127 self.cursor_y = cursor_y
128 addr = cursor_x & 0x3f
129 if cursor_y & 1:
130 addr += 0x40 # Lines 1 & 3 add 0x40
131 if cursor_y & 2: # Lines 2 & 3 add number of columns
132 addr += self.num_columns
133 self.hal_write_command(self.LCD_DDRAM | addr)
134
135 def putchar(self, char):
136 """Writes the indicated character to the LCD at the current cursor

Callers 5

putcharMethod · 0.95
custom_charMethod · 0.95
lcdPrintFunction · 0.80
lcdScrollFunction · 0.80
displayTempFunction · 0.80

Calls 1

hal_write_commandMethod · 0.95

Tested by

no test coverage detected