RPiLCD
🐍📟 RPiLCD is a Python library for controlling LCD character displays on the Raspberry Pi. It's designed to be easy, flexible, and compatible with I2C interfaces, making it perfect for your hardware projects.
Features
- Simple Interface: Provides an easy-to-use API for writing text, clearing the screen, and controlling the cursor.
- I2C Support: Works seamlessly with common I2C LCD backpack modules, saving you GPIO pins.
- Lightweight: Minimal dependencies, ensuring it's light on resources.
- Flexible: Easily integrate LCD display functionality into your Python scripts and applications running on a Raspberry Pi.
Installation
You can install the library using pip:
pip install LCDRPi
poetry install
The library depends on smbus for I2C communication and RPi.GPIO for pin control. These will be installed automatically.
Usage
Here is a basic example of how to initialize an I2C LCD and write text to it.
import time
from RPiLCD import LCD
# Assuming a 16x2 LCD with I2C address 0x27
# lcd = LCD(address=0x27, port=1, cols=16, rows=2)
# The library needs to be implemented. This is a placeholder for usage.
# A typical implementation would look like this:
class MockLCD:
def __init__(self, address, port, cols, rows):
print(f"Initializing LCD at address {address} on port {port} ({cols}x{rows})")
def text(self, message, line):
print(f"Writing to line {line}: {message}")
def clear(self):
print("Clearing the display.")
# Initialize the display
lcd = MockLCD(address=0x27, port=1, cols=16, rows=2)
try:
# Clear the display
lcd.clear()
# Write a message to the first line
lcd.text("Hello, World!", 1)
# Write a message to the second line
lcd.text("RPiLCD in action", 2)
time.sleep(5) # Wait for 5 seconds
lcd.clear()
except KeyboardInterrupt:
print("Program stopped.")
lcd.clear()
Dependencies
License
This project is licensed under the GNU Lesser General Public License v2.1. See the LICENSE file for more details.
Metadata
Release files for LCDRPi 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lcdrpi-1.0.0.tar.gz | 12.7 kB | Without provenance | Details for lcdrpi-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lcdrpi-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for lcdrpi-1.0.0-py3-none-any.whl |
Total release size: 26.5 kB
Release files / lcdrpi-1.0.0.tar.gz
| Download URL | lcdrpi-1.0.0.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5252a983975acaff93058817c18b479c53d3b59bbef8cfda752002c979626982
|
|
BLAKE2b-256 checksum How to use checksums |
6c15fc4f3f9747b1ecbcefe4e6f5c06f024608139c1b2ee2d37fffe71fff20ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.10.12 Linux/5.15.0-140-generic
|
Release files / lcdrpi-1.0.0-py3-none-any.whl
| Download URL | lcdrpi-1.0.0-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e4cbb5d9c7e510631a83d78364a9aff4ad2d8ee4e0fcf4937661c10f0127741
|
|
BLAKE2b-256 checksum How to use checksums |
a0553f49c445acfecaefc0e3ccda57998f56259727490b3c184b420d4f151484
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.10.12 Linux/5.15.0-140-generic
|
Security for LCDRPi 1.0.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.