Skip to content

Latest commit

 

History

History
77 lines (57 loc) · 2.77 KB

README.md

File metadata and controls

77 lines (57 loc) · 2.77 KB

Using a character LCD display with PyBoard:

A project including circuit and Python Module!

This project includes a python module with heavily commented code, meant for hobbyists to use and modify, as well as a Fritzing circuit diagram and photograph of the end result. This should allow you to attach a character display screen to your PyBoard very easily.

Required:

  • Pyboard 1.1 with micro-SD card
  • Standard sized breadboard
  • Wires
  • Mini breadboard-mount potentiometer
  • Some knowledge of Python.

Connection diagram

CHAR_LCD.py

CHAR_LCD.py is a module for micropython (meant for the PyBoard v1.0 or 1.1) meant to allow easy use of LCD character displays of the standard parallel-in type (viz, Hitachi HD44780 or compatible character display chipsets).

The code for this project has been released under the MIT License.

Tested on PyBoard v1.1 running micropython. (http://www.micropython.org)

TESTED LCDs:

  • Generic 16x2 green character display
  • Adafruit standard 20x4 blue character LCD

Compatibility:

  • Any LCD chipset compatible with the Hitachi HDD44780

This module should give you a pretty self-contained set of functions for writing text to a character LCD display of the standard 8-bit-parallel input kind.

This is a library of functions. Not a class. It would be unnecessary to make this a class, and would complexify the usage for hobbyists.

This library ASSUMES you are using PyBoard pins X1-X8 to communicate to the LCD display.

Requires: pyb module; stm module.

###Features Implemented:

  • CLEAR / RESET the display
  • multiple sizes (e.g. 16x2 or 20x4)
  • user specified command & latch pins
  • change to command mode or input mode
  • LOCATE cursor anywhere on the screen.
  • WRITE an ASCII character
  • WRITE a string
  • WRITE a full line of text

###Not Implemented:

  • Scrolling
  • Changing the text viewport in memory
  • Custom LCD characters
  • Serial in / out from character display
  • READ from character display

FURTHER READING:

###KNOWN ISSUES:

  • (Minor) clear_display() and reset_display() do not show consistent behavior for all displays.
  • (Minor) Sometimes you must call reset_display() twice (in a row) to get the desired behavior.

For more information read the code comments.

The code for CHAR_LCD.py is pretty heavily commented because this project is meant for hobbyists just starting out with PyBoard!