Skip to content
Prev Previous commit
Next Next commit
Update character_lcd.py
  • Loading branch information
profbrady authored Apr 12, 2019
commit ff1df52a0b9a4ef271c021c07f3fa5e8243fdf80
11 changes: 7 additions & 4 deletions adafruit_character_lcd/character_lcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def clear(self):
"""
self._write8(_LCD_CLEARDISPLAY)
time.sleep(0.003)

@property
def column_align(self):
"""If True, message text after '\n' starts directly below start of first
Expand All @@ -212,7 +212,10 @@ def column_align(self):

@column_align.setter
def column_align(self, enable):
self._column_align = enable
if isinstance(enable, bool):
self._column_align = enable
else:
raise ValueError('The column_align value must be either True or False')

@property
def cursor(self):
Expand Down Expand Up @@ -248,7 +251,7 @@ def cursor(self, show):
def cursor_position(self, column, row):
"""Move the cursor to position ``column``, ``row`` for the next
message only. Displaying a message resets the cursor position to (0, 0).

:param column: column location
:param row: row location
"""
Expand Down Expand Up @@ -395,7 +398,7 @@ def message(self, message):
self._write8(ord(character), True)
# reset column and row to (0,0) after message is displayed
self.column, self.row = 0, 0

def move_left(self):
"""Moves displayed text left one column.

Expand Down