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


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top