Coder Social home page Coder Social logo

micropython-i2c-lcd's Introduction

MicroPython I2C 16x2 LCD Screen

This library is designed to support a MicroPython interface for i2c LCD character screens. It's designed around the Pycom implementation of MicroPython so will need to be tweaked to work for CircuitPython.

Compatible LCDs

Tested Dev Kits

  • LoPy
  • WiPy
  • SiPy

Module

This module supports writing to, clearing and refreshing the LCD screen, among other functions.

write(text)

Prints text to LCD screen at the location of the cursor.

autoscroll(bool)

Enables lcd to scroll text as typed.

cursor(bool)

Sets cursor visibility.

blink(bool)

Sets blink visibility.

display(bool)

Sets display state (on/off).

home()

Returns the cursor to the (0,0) location on screen

move(col, row)

Moves the cursor to (col,row)

color(r, g, b)

Changes the color of the LCD Backlight to (r,g,b)

micropython-i2c-lcd's People

Contributors

bucknalla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

micropython-i2c-lcd's Issues

I2C.MASTER doesn't exist anymore

When importing this library I keep running into the following error:

>>> import i2c_lcd 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "i2c_lcd.py", line 10, in <module>
  File "i2c_lcd.py", line 14, in Display
AttributeError: type object 'I2C' has no attribute 'MASTER'

From what I understand from https://forum.micropython.org/viewtopic.php?t=2710 it's been deprecated, but I must admit that this lowlevel stuff isn't really something I'm used to. Does any of this make sense and would there be an easy way for me to patch this. Your library sounds exactly like what I need, since I want to control a Grove 16x2 display using an rpi pico.

autoscroll() bug

I tried Screen.autoscroll() with MicroPython 1.17 on NUCLEO-L476RG board,
and Grove 16x2 LCD RGB backlight v4.0
It does not work.

Here is my fix :

def autoscroll(self, state):
        if state:
            # self.disp_ctrl |= self.LCD_ENTRYSHIFTINCREMENT
            # self.cmd(self.LCD_DISPLAYCONTROL  | self.disp_ctrl)
            self.disp_mode |= self.LCD_ENTRYSHIFTINCREMENT  
            self.cmd(self.LCD_ENTRYMODESET  | self.disp_mode) 

        else:
            # self.disp_ctrl &= ~self.LCD_ENTRYSHIFTINCREMENT
            # self.cmd(self.LCD_DISPLAYCONTROL  | self.disp_ctrl)
            self.disp_mode &= ~self.LCD_ENTRYSHIFTINCREMENT  
            self.cmd(self.LCD_ENTRYMODESET  | self.disp_mode) 

OSError: I2C bus error

I tried to connect the RGB Backlight using your lib but I get an OSError.

I plugged it on VIN GND P21 and P22

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.