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

Features

  • 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)
lcd.init()

# 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)
lcd.print('the')

# 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


Download files

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

Source Distribution

i2clcd-0.0.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

i2clcd-0.0.1-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page