Esta librería es para el manejo de pantallas LCD en la Raspberry Pi
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lcdrpi-1.0.0.tar.gz.
File metadata
- Download URL: lcdrpi-1.0.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.12 Linux/5.15.0-140-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5252a983975acaff93058817c18b479c53d3b59bbef8cfda752002c979626982
|
|
| MD5 |
3e8f797b81115081486503e8f1b324f9
|
|
| BLAKE2b-256 |
6c15fc4f3f9747b1ecbcefe4e6f5c06f024608139c1b2ee2d37fffe71fff20ac
|
File details
Details for the file lcdrpi-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lcdrpi-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.12 Linux/5.15.0-140-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e4cbb5d9c7e510631a83d78364a9aff4ad2d8ee4e0fcf4937661c10f0127741
|
|
| MD5 |
0389d49c3f9ab590a8612b15ed04fdea
|
|
| BLAKE2b-256 |
a0553f49c445acfecaefc0e3ccda57998f56259727490b3c184b420d4f151484
|