Giter Site home page Giter Site logo

micropython-lcd's Introduction

micropython-lcd

A simple class for controlling the HD44780 in 4 bit mode with the micropython pyboard.

There are no external dependences, the only module we use is the pyboard's pyb.

Micropython Forum thread: http://forum.micropython.org/viewtopic.php?f=2&t=354

Usage

import pyb
from lcd import HD44780

lcd = HD44780()

lcd.PINS = ['Y1','Y2','Y3','Y4','Y5','Y6']

lcd.init()

lcd.set_line(0) # First line
lcd.set_string("ABCDEFGHIJKLMNOP") # Send a string
lcd.set_line(1) # Second line
lcd.set_string("1234567890123456") # Again

pyb.delay(3000) # 3 second delay

lcd.clear() # Clear the display

Pinout

Hookup your LCD like the following.

Pinout photo

Pin Code Description Do what with it
1 VSS GND Ground it
2 VDD +5V 5V please
3 V0 Contrast (0-5V)* Stick to 0V if you don't have a pot
4 RS Register select Connect to pyboard, 0 in array
5 R/W Read/write Ground it
6 E Enable Connect to pyboard, 1 in array
7 DB0 Data Bit 0 Unused
8 DB1 Data Bit 1 Unused
9 DB2 Data Bit 2 Unused
10 DB3 Data Bit 3 Unused
11 DB4 Data Bit 4 Connect to pyboard, 2 in array
12 DB5 Data Bit 5 Connect to pyboard, 3 in array
13 DB6 Data Bit 6 Connect to pyboard, 4 in array
14 DB7 Data Bit 7 Connect to pyboard, 5 in array
15 A Backlight +someV My display is LED, I use 3.3V
16 K Backlight GND Ground it

Then the pinout array looks like this

PINS = ['Y1','Y2','Y3','Y4','Y5','Y6']

micropython-lcd's People

Contributors

wjdp avatar

Stargazers

 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  avatar  avatar  avatar

micropython-lcd's Issues

Only update changed characters

Currently the set_string() function clears the entire display and rewrites the contents. This causes the display to 'flash'. It would be desired to only update changed characters when set_string() is called.

This is particularly obvious when making updates to the LCD with a short interval.

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.