Skip to main content

driver for LCD1602/2002/2004 with I2C adapter, for Raspberry Pi or other device

Project description

Python I2CLCD module

Python I2CLCD module for LCD1602/2002/2004 screen with I2C adapter
Can be used on embedded devices like the Raspberry Pi


  • Implemented most of the built-in instructions of LCD1602/2002/2004
  • Support for custom characters
  • Support backlight settings
  • Support 'Cursor or Display Shift' instructions
  • Hints for each method

Quick start

import i2clcd

lcd = i2clcd.i2clcd(i2c_bus=1, i2c_addr=0x27, lcd_width=16)

# fill a line by the text
lcd.print_line('hello', line=0)
lcd.print_line('world!', line=1, align='RIGHT')

# print text at the current cursor position
lcd.move_cursor(1, 0)

# custom character
char_celsius = (0x10, 0x06, 0x09, 0x08, 0x08, 0x09, 0x06, 0x00)
lcd.write_CGRAM(char_celsius, 0)
lcd.move_cursor(0, 6)
lcd.print(b'CGRAM: ' + i2clcd.CGRAM_CHR[0])

A photo for the result

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for i2clcd, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size i2clcd-0.0.1-py3-none-any.whl (4.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size i2clcd-0.0.1.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page