![]() |
Qwiic_SerLCD_Py
2.0.0-1-g5aa62c6
Python Driver for Qwiic I2C Serial LCDs
|
This class implements the basic functions of the Qwiic SerLCD device via the I2C bus. More...
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) | |
This class implements the basic functions of the Qwiic SerLCD device via the I2C bus.
| def qwiic_serlcd.QwiicSerlcd.__init__ | ( | self, | |
address = None, |
|||
i2c_driver = None |
|||
| ) |
| address | The I2C address to use for the device. If not provided, the default address is used. |
| i2c_driver | An existing i2c driver object. If not provided a driver object is created. |
| def qwiic_serlcd.QwiicSerlcd.autoscroll | ( | self | ) |
Turn autoscrolling on.
This will right-justify text from the cursor.
| def qwiic_serlcd.QwiicSerlcd.begin | ( | self | ) |
Initialize the operation of the SerLCD module.
| def qwiic_serlcd.QwiicSerlcd.blink | ( | self | ) |
Turn the blink cursor on.
| def qwiic_serlcd.QwiicSerlcd.clearScreen | ( | self | ) |
Sends the command to clear the screen.
| def qwiic_serlcd.QwiicSerlcd.command | ( | self, | |
| command | |||
| ) |
Send one setting command to the display.
Used by other functions.
| int | command: Command to send (a single byte) |
| def qwiic_serlcd.QwiicSerlcd.createChar | ( | self, | |
| location, | |||
| charmap | |||
| ) |
Create a custom character.
| int | location: character number 0 to 7 |
| list | of int charmap: byte array for character |
| def qwiic_serlcd.QwiicSerlcd.cursor | ( | self | ) |
Turn the underline cursor on.
| def qwiic_serlcd.QwiicSerlcd.disableSplash | ( | self | ) |
Disable splash screen at power on.
| def qwiic_serlcd.QwiicSerlcd.disableSystemMessages | ( | self | ) |
Disable system messages.
| def qwiic_serlcd.QwiicSerlcd.display | ( | self | ) |
Turn the display on quickly.
| def qwiic_serlcd.QwiicSerlcd.enableSplash | ( | self | ) |
Enable splash screen at power on.
| def qwiic_serlcd.QwiicSerlcd.enableSystemMessages | ( | self | ) |
Enable system messages.
| 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.
| 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.
| def qwiic_serlcd.QwiicSerlcd.leftToRight | ( | self | ) |
Set the text to flow from left to right.
| def qwiic_serlcd.QwiicSerlcd.moveCursorLeft | ( | self, | |
count = 1 |
|||
| ) |
Move the cursor one or more characters to the left.
| int | count: Number of character spaces you'd like to move |
| def qwiic_serlcd.QwiicSerlcd.moveCursorRight | ( | self, | |
count = 1 |
|||
| ) |
Move the cursor one or more characters to the right.
| int | count: Number of character spaces you'd like to move |
| def qwiic_serlcd.QwiicSerlcd.noAutoscroll | ( | self | ) |
Turn autoscrolling off.
| def qwiic_serlcd.QwiicSerlcd.noBlink | ( | self | ) |
Turn the blink cursor off.
| def qwiic_serlcd.QwiicSerlcd.noCursor | ( | self | ) |
Turn the underline cursor off.
| def qwiic_serlcd.QwiicSerlcd.noDisplay | ( | self | ) |
Turn the display off quickly.
| def qwiic_serlcd.QwiicSerlcd.print | ( | self, | |
| string | |||
| ) |
Print a string of characters to the LCD.
| string | string: The string you would like to print. Aka ASCII characters. example: "Hello" |
| def qwiic_serlcd.QwiicSerlcd.rightToLeft | ( | self | ) |
Set the text to flow from right to left.
| 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.
| def qwiic_serlcd.QwiicSerlcd.scrollDisplayLeft | ( | self, | |
count = 1 |
|||
| ) |
Scroll the display one or multiple characters to the left, without changing the text.
| int | count: Number of character spaces you'd like to scroll |
| def qwiic_serlcd.QwiicSerlcd.scrollDisplayRight | ( | self, | |
count = 1 |
|||
| ) |
Scroll the display one or multiple characters to the right, without changing the text.
| int | count: Number of character spaces you'd like to scroll |
| 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.
| int | new_addr: new i2c address |
| def qwiic_serlcd.QwiicSerlcd.setBacklight | ( | self, | |
| r, | |||
| g, | |||
| b | |||
| ) |
Set the brightness of each backlight (red, green, blue)
| int | red: The new red brightness value (0-255) |
| int | green: The new green brightness value (0-255) |
| int | blue: The new blue brightness value (0-255) |
| def qwiic_serlcd.QwiicSerlcd.setContrast | ( | self, | |
| contrast | |||
| ) |
Set the contrast of the LCD screen (0-255)
| int | contrast: The new contrast value (0-255) |
| def qwiic_serlcd.QwiicSerlcd.setCursor | ( | self, | |
| col, | |||
| row | |||
| ) |
Set the cursor position to a particular column and row.
| int | col: The column position (0-19) |
| int | row: The row position (0-3) |
| def qwiic_serlcd.QwiicSerlcd.setFastBacklight | ( | self, | |
| r, | |||
| g, | |||
| b | |||
| ) |
Set backlight with no LCD messages or delays.
| int | r: red backlight value 0-255 |
| int | g: green backlight value 0-255 |
| int | b: blue backlight value 0-255 |
| def qwiic_serlcd.QwiicSerlcd.specialCommand | ( | self, | |
| command, | |||
count = 1 |
|||
| ) |
Send one (or multiple) special commands to the display.
Used by other functions.
| int | command: Command to send (a single byte) |
| int | count: Number of times to send the command (if omitted, then default is once) |
| def qwiic_serlcd.QwiicSerlcd.writeChar | ( | self, | |
| location | |||
| ) |
Write a custom character to the display.
| int | location: character number 0 to 7 |
| qwiic_serlcd.QwiicSerlcd.address |
|
static |
|
static |
|
static |