Skip to main content

rpi_lcd_i2c_micropython

A small MicroPython driver for HD44780-compatible character LCDs connected through a common PCF8574 I2C backpack.

This is a MicroPython library. Install it onto a MicroPython board's filesystem; installing it with desktop CPython pip on Linux does not make machine available.

Usage

from machine import I2C, Pin
from rpi_lcd_i2c_micropython import I2cLcd

i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=400000)
print([hex(addr) for addr in i2c.scan()])

lcd = I2cLcd(i2c, 0x27, 2, 16)  # address, rows, columns
lcd.putstr("Hello, world!")
lcd.move_to(0, 1)
lcd.putstr("MicroPython")

Change the I2C bus, pins, address, row count, and column count for your board and LCD. Common backpack addresses are 0x27 and 0x3F; use i2c.scan() to check.

Install on a board

Copy the src/rpi_lcd_i2c_micropython/ package directory to the board's /lib/rpi_lcd_i2c_micropython/ directory using Thonny or mpremote. The package on PyPI is the source distribution for developers and tools; MicroPython boards do not generally run desktop pip directly.

Wiring caution

Use I2C signals that are safe for your board's logic voltage. Many LCD backpacks powered at 5 V pull SDA/SCL up to 5 V, which can damage 3.3 V boards. Use suitable level shifting or 3.3 V pull-ups.

Compatibility

This driver assumes the common PCF8574 backpack pin mapping. Some backpacks use a different mapping. Test on your target board before relying on it in a project.

Metadata

Release files for rpi-lcd-i2c-micropython 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rpi-lcd-i2c-micropython 0.1.0
File Size Uploaded Provenance
rpi_lcd_i2c_micropython-0.1.0.tar.gz 4.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rpi-lcd-i2c-micropython 0.1.0
File Interpreter ABI Platform
rpi_lcd_i2c_micropython-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / rpi_lcd_i2c_micropython-0.1.0.tar.gz

Download URL rpi_lcd_i2c_micropython-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1727707777d1e345e235c2cf7402514ab7882a9868ec9d4dcee66602cf310c6c
BLAKE2b-256 checksum
How to use checksums
f204face7676099e24c89ef2c0d58ed3e1eb2e4e844d6e0d48f5e7953173cd66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / rpi_lcd_i2c_micropython-0.1.0-py3-none-any.whl

Download URL rpi_lcd_i2c_micropython-0.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
987dbbfa8d9f7b3893921aefbd20be4483fbdd4961ef88abb5654327b6482b52
BLAKE2b-256 checksum
How to use checksums
e0627b579aaa8463731c8f8b8586e0f20a486c28b4b4083e85d4a893400481cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Security for rpi-lcd-i2c-micropython 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page