Character LCD over I2C

Introduction

This is project about simple library for communication Windows IoT with LCD character display over I2C bus. Just download the library from github and start creating your own projects.character lcd over i2c

Character LCD display over I2C

Connect HD44780 LCD character display to Windows 10 IoT devices via I2C and PCF8574

Basic usage (tl;dr)

Initialization

I2C bus is initialized by library constructor. You have to define there also PCF8574 pins.

displayI2C lcd = new displayI2C(DEVICE_I2C_ADDRESS, I2C_CONTROLLER_NAME, RS, RW, EN, D4, D5, D6, D7, BL);

Default DEVICE_I2C_ADDRESS is 0x27 (you can change it by A0-2 pins on PCF8574 – for more info please read datasheet)

I2C_CONTROLLER_NAME for Raspberry Pi 2 is "I2C1" (For Arduino it should be "I2C5", but I did’t test it.)

Other arguments are: RS = 0, RW = 1, EN = 2, D4 = 4, D5 = 5, D6 = 6, D7 = 7, BL = 3 (by default)

But the number of pins depends on your PCF8574.

Initialization of HD44780 display do by init method. More info

lcd.init();

Print string

Print string just by prints method e.g.

lcd.prints("Good morning");

————————————————————————————————————————-

Methods

init

Initialize HD44780 display

Arguments:

  • bool turnOnDisplay (default: true)
  • bool turnOnCursor (default: false)
  • bool blinkCursor (default: false)
  • bool cursorDirection (default: true)
  • bool textShift (default: false)

turnOnBacklight

Turn the Back light ON

No arguments

turnOffBacklight

Turn the Back light OFF

No arguments

prints

Print string to display

Arguments:

  • string text

printc

Print char to display

Arguments:

  • char letter

gotoSecondLine

Move cursor to start of the second line

No arguments

gotoxy

Move cursor to X and Y coordinates

Arguments:

  • byte x
  • byte y

schematic character lcd over i2c

clrscr

Clear screen and move cursor to start

No arguments

createSymbol

Create custom symbol

Arguments:

  • byte[] data
  • byte address

printSymbol

Print custom symbol

Arguments:

  • byte address

For more detail: Character LCD over I2C

Scroll to Top
Read previous post:
shift register sample
Shift Register Sample

Story In this sample, we’ll connect an 8-bit serial-in, parallel-out shift register to your Raspberry Pi 2 and create a...

Close