Skip to main content

CircuitPython library for standard character LCDs.

Project description

Introduction

Documentation Status Discord Build Status Code Style: Ruff

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adafruit_circuitpython_charlcd-3.5.7.tar.gz (34.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adafruit_circuitpython_charlcd-3.5.7-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file adafruit_circuitpython_charlcd-3.5.7.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_charlcd-3.5.7.tar.gz
Algorithm Hash digest
SHA256 f81224258fe36c558ebd5811c89ba1d4a8fc0ff723e48046b4178aee6f177d12
MD5 ff702907c8fc40ccaf6fb09dbfce9ebc
BLAKE2b-256 22e529697595cca8c696cbd3447b25bb70a44fcaad54e4caefb8edcc4ed3dcbc

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_charlcd-3.5.7-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_charlcd-3.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5395bce5b48f5a53e7de6afb4c56db15c0629f784a07c91cd021314c911385f5
MD5 82bb1f52340fc03ffb2539b6f5af36d2
BLAKE2b-256 bfcec7e7e0e4bd48a5aa30b7904d69bbdeb6245a487f36c654d43b54af7b5519

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page