Skip to main content

Simple module for using a HD44780 LCD over I2C

Project description

RPi_GPIO_i2c_LCD

HD44780 / PCF8574 LCD Module

Sections

  • Description
  • Features
  • Install
  • Usage

Description

A simple module for working with the HD44780 LCD over I²C using the PCF8574 Backpack

Features

  • Non-Blocking update loop
  • Supports 2x16 and 4x20 Displays
  • Easy to use
  • Callback loop for updating display directly

Install

Using PyPi:

pip3 install RPi-GPIO-I2C-LCD

Usage

Simple
from RPi_GPIO_i2c_LCD import lcd
from time import sleep

## Address of backpack
i2c_address = 0x27

## Initalize display
lcdDisplay = lcd.HD44780(i2c_address)

## Set string value to buffer
lcdDisplay.set("Hello",1)
lcdDisplay.set("World",2)

sleep(1)

Callback Loop

from RPi_GPIO_i2c_LCD import lcd
from time import sleep, strftime

## Callback function that will run on every display loop
def MyFunction(self):
    ## Show current time on line 2
    self.lcd.display_string(str(strftime("%d/%m %H:%M:%S").center(20,' ')),2)

## Initalize display with callback
lcdDisplay = lcd.HD44780(0x27,MyFunction)

## Set string value to buffer
lcdDisplay.set("The time is:",1)
sleep(6)

Project details


Download files

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

Files for RPi-GPIO-i2c-LCD, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size RPi_GPIO_i2c_LCD-0.1.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page