Qwiic_SerLCD_Py  v0.0.1_test-5-g73badb5
Python Driver for Qwiic I2C Serial LCDs
Loading...
Searching...
No Matches
qwiic_serlcd.QwiicSerlcd Class Reference

This class implements the basic functions of the Qwiic SerLCD device via the I2C bus. More...

Inheritance diagram for qwiic_serlcd.QwiicSerlcd:

Public Member Functions

def __init__ (self, address=None, i2c_driver=None)
 
def is_connected (self)
 Determine if a device is connected to the system. More...
 
def begin (self)
 Initialize the operation of the SerLCD module. More...
 
def print (self, string)
 Print a string of characters to the LCD. More...
 
def clearScreen (self)
 Sends the command to clear the screen. More...
 
def home (self)
 Send the home command to the display. More...
 
def setCursor (self, col, row)
 Set the cursor position to a particular column and row. More...
 
def setContrast (self, contrast)
 Set the contrast of the LCD screen (0-255) More...
 
def setBacklight (self, r, g, b)
 Set the brightness of each backlight (red, green, blue) More...
 
def specialCommand (self, command, count=1)
 Send one (or multiple) special commands to the display. More...
 
def command (self, command)
 Send one setting command to the display. More...
 
def moveCursorLeft (self, count=1)
 Move the cursor one or more characters to the left. More...
 
def moveCursorRight (self, count=1)
 Move the cursor one or more characters to the right. More...
 
def cursor (self)
 Turn the underline cursor on. More...
 
def noCursor (self)
 Turn the underline cursor off. More...
 
def blink (self)
 Turn the blink cursor on. More...
 
def noBlink (self)
 Turn the blink cursor off. More...
 
def scrollDisplayLeft (self, count=1)
 Scroll the display one or multiple characters to the left, without changing the text. More...
 
def scrollDisplayRight (self, count=1)
 Scroll the display one or multiple characters to the right, without changing the text. More...
 
def autoscroll (self)
 Turn autoscrolling on. More...
 
def noAutoscroll (self)
 Turn autoscrolling off. More...
 
def leftToRight (self)
 Set the text to flow from left to right. More...
 
def rightToLeft (self)
 Set the text to flow from right to left. More...
 
def createChar (self, location, charmap)
 Create a custom character. More...
 
def writeChar (self, location)
 Write a custom character to the display. More...
 
def display (self)
 Turn the display on quickly. More...
 
def noDisplay (self)
 Turn the display off quickly. More...
 
def setFastBacklight (self, r, g, b)
 Set backlight with no LCD messages or delays. More...
 
def enableSystemMessages (self)
 Enable system messages. More...
 
def disableSystemMessages (self)
 Disable system messages. More...
 
def enableSplash (self)
 Enable splash screen at power on. More...
 
def disableSplash (self)
 Disable splash screen at power on. More...
 
def saveSplash (self)
 Save the current display as the splash Saves whatever is currently being displayed into EEPROM This will be displayed at next power on as the splash screen. More...
 
def setAddress (self, new_addr)
 Change the I2C Address. More...
 

Public Attributes

 address
 

Static Public Attributes

 device_name = _DEFAULT_NAME
 
 available_addresses = _AVAILABLE_I2C_ADDRESS
 

Properties

 connected = property(is_connected)
 

Detailed Description

This class implements the basic functions of the Qwiic SerLCD device via the I2C bus.

Constructor & Destructor Documentation

◆ __init__()

def qwiic_serlcd.QwiicSerlcd.__init__ (   self,
  address = None,
  i2c_driver = None 
)
Parameters
addressThe I2C address to use for the device. If not provided, the default address is used.
i2c_driverAn existing i2c driver object. If not provided a driver object is created.
Returns
: Object The QwiicSerlcd device object.

Member Function Documentation

◆ autoscroll()

def qwiic_serlcd.QwiicSerlcd.autoscroll (   self)

Turn autoscrolling on.

This will right-justify text from the cursor.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ begin()

def qwiic_serlcd.QwiicSerlcd.begin (   self)

Initialize the operation of the SerLCD module.

Returns
bool Returns true if the initialization was successful, otherwise False.

◆ blink()

def qwiic_serlcd.QwiicSerlcd.blink (   self)

Turn the blink cursor on.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ clearScreen()

def qwiic_serlcd.QwiicSerlcd.clearScreen (   self)

Sends the command to clear the screen.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ command()

def qwiic_serlcd.QwiicSerlcd.command (   self,
  command 
)

Send one setting command to the display.

Used by other functions.

Parameters
intcommand: Command to send (a single byte)
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ createChar()

def qwiic_serlcd.QwiicSerlcd.createChar (   self,
  location,
  charmap 
)

Create a custom character.

Parameters
intlocation: character number 0 to 7
listof int charmap: byte array for character
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ cursor()

def qwiic_serlcd.QwiicSerlcd.cursor (   self)

Turn the underline cursor on.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ disableSplash()

def qwiic_serlcd.QwiicSerlcd.disableSplash (   self)

Disable splash screen at power on.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ disableSystemMessages()

def qwiic_serlcd.QwiicSerlcd.disableSystemMessages (   self)

Disable system messages.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ display()

def qwiic_serlcd.QwiicSerlcd.display (   self)

Turn the display on quickly.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ enableSplash()

def qwiic_serlcd.QwiicSerlcd.enableSplash (   self)

Enable splash screen at power on.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ enableSystemMessages()

def qwiic_serlcd.QwiicSerlcd.enableSystemMessages (   self)

Enable system messages.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ home()

def qwiic_serlcd.QwiicSerlcd.home (   self)

Send the home command to the display.

This returns the cursor to the beginning of the display, without clearing the display.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ is_connected()

def qwiic_serlcd.QwiicSerlcd.is_connected (   self)

Determine if a device is connected to the system.

This method checks if the device with the specified I2C address is connected to the system.

Returns
bool True if the device is connected, otherwise False.

◆ leftToRight()

def qwiic_serlcd.QwiicSerlcd.leftToRight (   self)

Set the text to flow from left to right.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ moveCursorLeft()

def qwiic_serlcd.QwiicSerlcd.moveCursorLeft (   self,
  count = 1 
)

Move the cursor one or more characters to the left.

Parameters
intcount: Number of character spaces you'd like to move
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ moveCursorRight()

def qwiic_serlcd.QwiicSerlcd.moveCursorRight (   self,
  count = 1 
)

Move the cursor one or more characters to the right.

Parameters
intcount: Number of character spaces you'd like to move
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ noAutoscroll()

def qwiic_serlcd.QwiicSerlcd.noAutoscroll (   self)

Turn autoscrolling off.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ noBlink()

def qwiic_serlcd.QwiicSerlcd.noBlink (   self)

Turn the blink cursor off.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ noCursor()

def qwiic_serlcd.QwiicSerlcd.noCursor (   self)

Turn the underline cursor off.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ noDisplay()

def qwiic_serlcd.QwiicSerlcd.noDisplay (   self)

Turn the display off quickly.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ print()

def qwiic_serlcd.QwiicSerlcd.print (   self,
  string 
)

Print a string of characters to the LCD.

Parameters
stringstring: The string you would like to print. Aka ASCII characters. example: "Hello"
Returns
bool Returns True if the I2C writes were successful, otherwise False.

◆ rightToLeft()

def qwiic_serlcd.QwiicSerlcd.rightToLeft (   self)

Set the text to flow from right to left.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ saveSplash()

def qwiic_serlcd.QwiicSerlcd.saveSplash (   self)

Save the current display as the splash Saves whatever is currently being displayed into EEPROM This will be displayed at next power on as the splash screen.

Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ scrollDisplayLeft()

def qwiic_serlcd.QwiicSerlcd.scrollDisplayLeft (   self,
  count = 1 
)

Scroll the display one or multiple characters to the left, without changing the text.

Parameters
intcount: Number of character spaces you'd like to scroll
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ scrollDisplayRight()

def qwiic_serlcd.QwiicSerlcd.scrollDisplayRight (   self,
  count = 1 
)

Scroll the display one or multiple characters to the right, without changing the text.

Parameters
intcount: Number of character spaces you'd like to scroll
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ setAddress()

def qwiic_serlcd.QwiicSerlcd.setAddress (   self,
  new_addr 
)

Change the I2C Address.

0x72 is the default. Note that this change is persistent. If anything goes wrong you may need to do a hardware reset to unbrick the display.

Parameters
intnew_addr: new i2c address
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ setBacklight()

def qwiic_serlcd.QwiicSerlcd.setBacklight (   self,
  r,
  g,
  b 
)

Set the brightness of each backlight (red, green, blue)

Parameters
intred: The new red brightness value (0-255)
intgreen: The new green brightness value (0-255)
intblue: The new blue brightness value (0-255)
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ setContrast()

def qwiic_serlcd.QwiicSerlcd.setContrast (   self,
  contrast 
)

Set the contrast of the LCD screen (0-255)

Parameters
intcontrast: The new contrast value (0-255)
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ setCursor()

def qwiic_serlcd.QwiicSerlcd.setCursor (   self,
  col,
  row 
)

Set the cursor position to a particular column and row.

Parameters
intcol: The column position (0-19)
introw: The row position (0-3)
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ setFastBacklight()

def qwiic_serlcd.QwiicSerlcd.setFastBacklight (   self,
  r,
  g,
  b 
)

Set backlight with no LCD messages or delays.

Parameters
intr: red backlight value 0-255
intg: green backlight value 0-255
intb: blue backlight value 0-255
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ specialCommand()

def qwiic_serlcd.QwiicSerlcd.specialCommand (   self,
  command,
  count = 1 
)

Send one (or multiple) special commands to the display.

Used by other functions.

Parameters
intcommand: Command to send (a single byte)
intcount: Number of times to send the command (if omitted, then default is once)
Returns
bool Returns True if the I2C write was successful, otherwise False.

◆ writeChar()

def qwiic_serlcd.QwiicSerlcd.writeChar (   self,
  location 
)

Write a custom character to the display.

Parameters
intlocation: character number 0 to 7
Returns
bool Returns True if the I2C write was successful, otherwise False.

Member Data Documentation

◆ address

qwiic_serlcd.QwiicSerlcd.address

◆ available_addresses

qwiic_serlcd.QwiicSerlcd.available_addresses = _AVAILABLE_I2C_ADDRESS
static

◆ device_name

qwiic_serlcd.QwiicSerlcd.device_name = _DEFAULT_NAME
static

Property Documentation

◆ connected

qwiic_serlcd.QwiicSerlcd.connected = property(is_connected)
static

The documentation for this class was generated from the following file: