i2c_lcd package¶
Submodules¶
i2c_lcd.i2c_lcd module¶
GPL-licensed code found on GitHub Gists, contained below with some slight adjustments. Taken 2017-3-26.
https://gist.github.com/DenisFromHR/cc863375a6e19dce359d#file-rpi_i2c_driver-py
-
class
i2c_lcd.i2c_lcd.
i2c_device
(addr=39, port=1)[source]¶ Class for communicating with I2C devices over SMBus.
Used to help the lcd class communicate with an I2C device via SMBus.
- Args:
- addr (hex str): Hex address of I2C device port (int): port for SMBus
-
class
i2c_lcd.i2c_lcd.
lcd
(addr=39)[source]¶ Class for interfacing with I2C LCD device.
-
backlight_on
(set_to_on)[source]¶ Define backlight as on/off.
- Args:
- set_to_on (bool): True sets backlight on, False sets off.
-
lcd_display_string
(string, line)[source]¶ Displays string on lcd screen.
- Args:
- string (str): String to be displayed. line (int): Line for string to be displayed on. Must be 1-4.
-
lcd_display_string_pos
(string, line, pos)[source]¶ Display string in precise position/offset.
- Args:
- string (str): String to be displayed. line (int): Line for string to be displayed on. Must be 1-4. pos (int): Offset for displaying string
-
lcd_load_custom_chars
(fontdata)[source]¶ Load custom characters from font data.
- Args:
- fontdata (char[]): font data, max 7 characters.
-
lcd_write
(cmd, mode=0)[source]¶ Write a command to lcd.
- Args:
- cmd (hex str): Hex command. mode (int): Mode? Defaults to 0.
-
Module contents¶
-
class
i2c_lcd.
lcd
(addr=39)[source]¶ Class for interfacing with I2C LCD device.
-
backlight_on
(set_to_on)[source]¶ Define backlight as on/off.
- Args:
- set_to_on (bool): True sets backlight on, False sets off.
-
lcd_display_string
(string, line)[source]¶ Displays string on lcd screen.
- Args:
- string (str): String to be displayed. line (int): Line for string to be displayed on. Must be 1-4.
-
lcd_display_string_pos
(string, line, pos)[source]¶ Display string in precise position/offset.
- Args:
- string (str): String to be displayed. line (int): Line for string to be displayed on. Must be 1-4. pos (int): Offset for displaying string
-
lcd_load_custom_chars
(fontdata)[source]¶ Load custom characters from font data.
- Args:
- fontdata (char[]): font data, max 7 characters.
-
lcd_write
(cmd, mode=0)[source]¶ Write a command to lcd.
- Args:
- cmd (hex str): Hex command. mode (int): Mode? Defaults to 0.
-