https://github.com/tomplus/dfrgblcdpy
Python library to control DFRobot Gravity I2C LCD1602 with RGB Backlight Display
https://github.com/tomplus/dfrgblcdpy
lcd-display raspberry
Last synced: 5 months ago
JSON representation
Python library to control DFRobot Gravity I2C LCD1602 with RGB Backlight Display
- Host: GitHub
- URL: https://github.com/tomplus/dfrgblcdpy
- Owner: tomplus
- License: mit
- Created: 2024-12-18T21:39:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-01T17:56:58.000Z (over 1 year ago)
- Last Synced: 2025-02-01T19:16:42.902Z (over 1 year ago)
- Topics: lcd-display, raspberry
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DFRGBLCDpy


Python library to control DFRobot Gravity I2C LCD1602 with RGB Backlight Display or similar.
## About
This library is based on official library [DFRobot_RGBLCD1602](https://github.com/DFRobot/DFRobot_RGBLCD1602)
to control [DFRobot Gravity I2C LCD1602](https://www.dfrobot.com/product-1609.html). The offical library uses
deprecated _wiringpi_, but this uses _smbus_ and it's released as a standalone library.
Feel free to use and enjoy your LCD.
## Getting Started
### Requirements
1. Connect your LCD to RPi via I2C pinouts, it accepts 5V.
2. Enable I2C on your RPi (using _raspi-config_)
3. Install (_apt-get install i2c-tools_) and use _i2cdetect_ to check addresses.
Example:
```
$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- 2d -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3e --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
```
(the module uses 2 addresses)
Alternatively you can assume that the LCD has an address **0x3e**
and RGB's address depends on the hardware version: **0x2d** (RGB V2.0),
0x60 (RGB V1.0), 0x6b (V1.1), 0x30 (V1.0).
## Installation
```
pip install dfrgblcdpy
```
## Examples
```python
from dfrgblcdpy import DFRRGBLCDPY
# default addresses
lcd = DFRRGBLCDPY()
# set white backlight
lcd.set_color_white()
# first line
lcd.print_out("Hello!")
# second line
lcd.set_cursor(0, 1)
lcd.print_out("World!")
```
## Documentation
See `docs/dfrgblcdpy.html`
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.