A Raspberry Pi LCD library for the widely used Hitachi HD44780 controller.
A Python 3/2 Raspberry PI Character LCD library for the Hitachi HD44780 controller. It supports both GPIO (parallel) mode as well as boards with an I²C port expander (e.g. the PCF8574 or the MCP23008).
For GPIO mode, no external dependencies (except the RPi.GPIO library, which comes preinstalled on Raspbian) are needed to use this library. If you want to control LCDs via I²C, then you also need the python-smbus library. If you want to control the LCD with pigpio, you have to install the pigpio library.
If you’re trying to get started with RPLCD, you should probably read the docs :)
You can install RPLCD directly from PyPI using pip:
$ sudo pip install RPLCD
If you want to use I²C, you also need smbus:
$ sudo apt install python-smbus
You can also install the library manually without pip. Either just copy the scripts to your working directory and import them, or download the repository and run python setup.py install to install it into your Python package directory.
- Simple to use API
- Support for both 4 bit and 8 bit modes
- Support for both parallel (GPIO) and I²C connection
- Support for custom characters
- Support for backlight control circuits
- Built-in support for A00 and A02 character tables
- Python 2/3 compatible
- Caching: Only write characters if they changed
- No external dependencies (except RPi.GPIO, and python-smbus if you need I²C support)
These things may get implemented in the future, depending on my free time and motivation:
- MicroPython port
Supported I²C Port Expanders
- PCF8574 (used by a lot of I²C LCD adapters on Ali Express)
- MCP23008 (used in Adafruit I²C LCD backpack)
Interactive Test Script
To test your LCD, please run the lcdtest.py script with the testsuite target.
There are also unit tests. First, install dependencies:
pip install -U -r requirements-dev.txt
Then run the tests:
flake8 --max-line-length=99 --ignore=E126,E127,E128,C901 RPLCD/lcd.py
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash SHA256 hash help||File type||Python version||Upload date|
|RPLCD-1.1.0-py2.py3-none-any.whl (37.8 kB) Copy SHA256 hash SHA256||Wheel||py2.py3||Apr 6, 2018|
|RPLCD-1.1.0.tar.gz (28.3 kB) Copy SHA256 hash SHA256||Source||None||Apr 6, 2018|