Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Backlight now a property.
  • Loading branch information
kattni committed Nov 17, 2018
commit de93de21874cd52347d0d8e5918fc2d698fbf50e
11 changes: 9 additions & 2 deletions adafruit_character_lcd/character_lcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def __init__(self, rs, en, d4, d5, d6, d7, cols, lines,
self.clear()

self._message = None
self._enable = None
#pylint: enable-msg=too-many-arguments

def home(self):
Expand Down Expand Up @@ -305,7 +306,13 @@ def right_to_left(self, right_to_left):
self.displaymode &= ~_LCD_ENTRYLEFT
self._write8(_LCD_ENTRYMODESET | self.displaymode)

@property
def backlight(self):
return self._enable

@backlight.setter
def backlight(self, enable):
self._enable = enable
"""
Set lighton to turn the charLCD backlight on.

Expand All @@ -321,9 +328,9 @@ def create_char(self, location, pattern):
"""
Fill one of the first 8 CGRAM locations with custom characters.
The location parameter should be between 0 and 7 and pattern should
provide an array of 8 bytes containing the pattern. E.g. you can easyly
provide an array of 8 bytes containing the pattern. E.g. you can easily
design your custom character at http://www.quinapalus.com/hd44780udg.html
To show your custom character use eg. lcd.message('\x01')
To show your custom character use eg. lcd.message = "\x01"

:param location: integer in range(8) to store the created character
:param ~bytes pattern: len(8) describes created character
Expand Down