Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tomplus/DFRGBLCDpy

Repository files navigation

DFRGBLCDpy

Build status PyPI version

Python library to control DFRobot Gravity I2C LCD1602 with RGB Backlight Display or similar.

About

This library is based on official library DFRobot_RGBLCD1602 to control DFRobot Gravity I2C LCD1602. 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

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.

About

Python library to control DFRobot Gravity I2C LCD1602 with RGB Backlight Display

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •