CircuitPython library for standard character LCDs.
Project description
Introduction
This library is compatible with standard Character LCDs such as:
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install adafruit-circuitpython-charlcd
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-charlcd
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-charlcd
Dependencies
This driver depends on:
I2C & SPI displays also depend on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Usage Example
The Character_LCD class interfaces a predefined Character LCD display with CircuitPython.
import board
import digitalio
import adafruit_character_lcd.character_lcd as character_lcd
You must define the data pins (RS, EN, D4, D5, D6, D7) in your code before using the Character_LCD class. If you want to have on/off backlight functionality, you can also define your backlight as lcd_backlight. Otherwise, the backlight will always remain on. The following is an example setup.
lcd_rs = digitalio.DigitalInOut(board.D7)
lcd_en = digitalio.DigitalInOut(board.D8)
lcd_d7 = digitalio.DigitalInOut(board.D12)
lcd_d6 = digitalio.DigitalInOut(board.D11)
lcd_d5 = digitalio.DigitalInOut(board.D10)
lcd_d4 = digitalio.DigitalInOut(board.D9)
lcd_backlight = digitalio.DigitalInOut(board.D13)
You must also define the size of the CharLCD by specifying its lcd_columns and lcd_rows:
lcd_columns = 16
lcd_rows = 2
After you have set up your LCD, we can make the device by calling it
lcd = character_lcd.Character_LCD_Mono(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)
To verify that your pins are correct, print a hello message to the CharLCD:
lcd.message = "Hello\nCircuitPython"
Custom character example with create_char() is provided within /examples/
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
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
File details
Details for the file adafruit_circuitpython_charlcd-3.4.11.tar.gz
.
File metadata
- Download URL: adafruit_circuitpython_charlcd-3.4.11.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b5166b3d6ca5aa91d54253a6d6eccc42d251cee13829c0e8e015ad215a36766 |
|
MD5 | fabbba88d40fe89d7b12d26980b6b6a5 |
|
BLAKE2b-256 | 16604386c91c1cd14efc4d0060f46cf7412a4482f52da450df62eccc87d09892 |
File details
Details for the file adafruit_circuitpython_charlcd-3.4.11-py3-none-any.whl
.
File metadata
- Download URL: adafruit_circuitpython_charlcd-3.4.11-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f78c317794bde33920b03e78525e5945d4dc40f9c8a8662206708855b3032751 |
|
MD5 | cc043a738f58fa518edaa2d22c7419f4 |
|
BLAKE2b-256 | 5ddedc68b8cf2d62f0878c3a94c64615d69e64a4d722f6f759f621c190a720cf |