Closed wiryonolau closed 5 years ago
awesome, thank you for the contribution - can you update the documentation and some spacing stuff so that pylint is happy?
see: https://travis-ci.com/adafruit/Adafruit_CircuitPython_CharLCD/builds/106145058#L605
you can use our files as examples https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/blob/master/adafruit_character_lcd/character_lcd_rgb_i2c.py
Oh.. I see it's because of the space. Ok will do.
Hi I kept getting this error on Ci Test
Warning, treated as error: ../README.rst:119:undefined label: bundle_installation (if the link has no caption the label must precede a section header) The command "cd docs && sphinx-build -E -W -b html . _build/html && cd .." exited with 2.
can you help me, I never use sphinx
@ladyada Should this somehow live in the community bundle side of things?
@caternuson it could but i dont think that's likely to happen :/
@wiryonolau You didn't do anything to this file, but the README.rst looks older style. I'd say just go ahead and delete that entire "Installation" section that's between "Contributing" and "Building Locally". It's not even in the current boiler plate: https://github.com/adafruit/cookiecutter-adafruit-circuitpython/blob/master/%7B%7B%20cookiecutter.library_name%20%7D%7D/README.rst Hopefully that'll at least get travis to pass.
@wiryonolau this looks like its just a direct clone of our i2c shield, so why dont you use https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/blob/master/adafruit_character_lcd/character_lcd_rgb_i2c.py ?
Sorry I thought changing the iodira after Character_LCD init() will not work. After retesting it work ok.
import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
from adafruit_character_lcd.character_lcd import _set_bit as set_bit
import time
import board
import busio
i2c = busio.I2C(board.SCL, board.SDA)
lcd_columns = 16
lcd_rows = 2
lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
# This is the only difference when using sainsmart. It has mono lcd with rgb led on top of the lcd.
lcd._mcp.iodira = set_bit(lcd._mcp.iodira, 5, 0)
lcd.clear()
# Turn on backlight LCD, LED become purple so have to clear it
lcd._mcp.gpioa = set_bit(lcd._mcp.gpioa, 5, 0)
lcd.color = [0,0,0]
# Other function work normally as rgb_i2c example
# Turn off backlight LCD, LED color is not affected so require to clear it manually
lcd._mcp.gpioa = set_bit(lcd._mcp.gpioa, 5, 1)
lcd.color = [0,0,0]
Maybe changing _set_bit to public set_bit and _mcp to mcp will be cleanner. Since I require to access it multiple time :D
I will withdraw the pull request then
Added sainsmart lcd with led