Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adafruit/adafruit_circuitpython_charlcd
Library code for character LCD interfacing
https://github.com/adafruit/adafruit_circuitpython_charlcd
character circuitpython hacktoberfest lcd rgb-led
Last synced: 4 days ago
JSON representation
Library code for character LCD interfacing
- Host: GitHub
- URL: https://github.com/adafruit/adafruit_circuitpython_charlcd
- Owner: adafruit
- License: mit
- Created: 2017-06-09T23:23:10.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-01-16T18:45:59.000Z (22 days ago)
- Last Synced: 2025-01-27T05:45:55.234Z (11 days ago)
- Topics: character, circuitpython, hacktoberfest, lcd, rgb-led
- Language: Python
- Size: 475 KB
- Stars: 72
- Watchers: 25
- Forks: 50
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Introduction
============.. image:: https://readthedocs.org/projects/adafruit-circuitpython-charlcd/badge/?version=latest
:target: https://docs.circuitpython.org/projects/charlcd/en/latest/
:alt: Documentation Status.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord.. image:: https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/actions/
:alt: Build Status.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: BlackThis library is compatible with standard Character LCDs such as:
* `Adafruit Standard LCD 16x2 `_
* `Adafruit RGB backlight negative LCD 16x2 `_
* `Adafruit RGB backlight negative LCD 20x4 `_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:.. code-block:: shell
pip3 install adafruit-circuitpython-charlcd
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install adafruit-circuitpython-charlcd
To install in a virtual environment in your current project:
.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-charlcdDependencies
=============
This driver depends on:* `Adafruit CircuitPython `_
* `Adafruit CircuitPython BusDevice `_
* `Adafruit CircuitPython MCP230xx `_
* `Adafruit CircuitPython 74HC595 `_I2C & SPI displays also depend on:
* `Bus Device `_
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.
.. code-block:: python
import board
import digitalio
import adafruit_character_lcd.character_lcd as character_lcdYou 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... code-block:: python
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``:
.. code-block:: python
lcd_columns = 16
lcd_rows = 2After you have set up your LCD, we can make the device by calling it
.. code-block:: python
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:
.. code-block:: python
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.