https://github.com/bogdal/rpi-lcd
I²C LCD library for RaspberryPi
https://github.com/bogdal/rpi-lcd
Last synced: about 1 year ago
JSON representation
I²C LCD library for RaspberryPi
- Host: GitHub
- URL: https://github.com/bogdal/rpi-lcd
- Owner: bogdal
- License: mit
- Created: 2016-09-07T21:15:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-03-01T11:21:56.000Z (over 4 years ago)
- Last Synced: 2025-03-18T05:43:53.809Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 24
- Watchers: 4
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
rpi-lcd
=======
This library supports LCD text displays (20x4, 16x2 and other) via I²C converter.
It requires the ``python-smbus`` package installed on your Raspberry Pi and enabled ``ARM I2C`` interface.
Installation
------------
Get the package from ``pypi``::
pip install rpi-lcd
Usage
-----
.. code-block:: python
from rpi_lcd import LCD
from time import sleep
lcd = LCD()
lcd.text('Hello World!', 1)
lcd.text('Raspberry Pi', 2)
lcd.text('is really', 3, 'center')
lcd.text('awesome', 4, 'right')
sleep(5)
lcd.clear()
``rpi-lcd`` handles multiline texts::
from rpi_lcd import LCD
lcd = LCD()
lcd.text('This is a message that has more than 20 chars and does not fit in one line', 1)
.. image:: https://github-bogdal.s3.amazonaws.com/rpi-lcd/lcd_text.jpeg