Skip to content

Library for interfacing with HD44780 LCD with I2C backpack

License

Notifications You must be signed in to change notification settings

devgiants/esp8266_hd44780_i2c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

HD44780 I2C Lua driver

This is a library intended to be used with ESP8266 NodeMCU in order to interface easily with any HD44780 LCD with I2C backpack.

Example

-- Get library
dofile('lcd.lua')
-- Init device communication.
-- In this example, pin 3 -> SDA, pin 4 -> SCL, 0x27 is the device I2C address, 20 columns, 4 rows (4x20 LCD display)
if(hd44780.init(3,4,0x27,20,4)) then
    -- Set backlight on
    hd44780.setBacklight(hd44780.BACKLIGHT_ON)
    -- Set cursor 5th columns 1st line
    hd44780.setCursor(5,0)
    -- Print text
    hd44780.printString('first line')
    hd44780.setCursor(1,1)
    hd44780.printString('second line')
    hd44780.setCursor(6,2)
    hd44780.printString('third line')
    hd44780.setCursor(0,3)
    hd44780.printString('fourth line')

    tmr.delay(1000000)
    -- Clear screen
    hd44780.clear()
    tmr.delay(1000000)
    hd44780.setBacklight(hd44780.BACKLIGHT_OFF)
    tmr.delay(1000000)
    hd44780.setCursor(5,0)
    hd44780.printString('first line')
    hd44780.setCursor(1,1)
    hd44780.printString('second line')
    hd44780.setCursor(6,2)
    hd44780.printString('third line')
    hd44780.setCursor(0,3)
    hd44780.printString('fourth line')
    hd44780.printString('V1.0')
end

About

Library for interfacing with HD44780 LCD with I2C backpack

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages