Miss any of our Open RFC calls?Watch the recordings here! »

i2c-lcd

1.0.2 • Public • Published

i2c LCD

i2c LCD module using PCF8574P for raspberry pi

Install

npm instal i2c-lcd

Hardware

Testd with:

  • 2004 LCD Display Module HD44780 (20x4)
  • 1602 LCD Display Module HD44780 (16x2)

Usage Example

LCD = require("./lcd")
 
lcd = new LCD("/dev/i2c-1"0x27)
lcd.init()
.then( ->
  return lcd.createChar(0[
    0x1b0x150x0e0x1b,
    0x150x1b0x150x0e
  ])
).then( ->
  return lcd.createChar(1[
    0x0c0x120x120x0c
    0x000x000x000x00
  ])
)
.then( -> lcd.home() )
.then( -> lcd.print("Raspberry Pi #{String.fromCharCode(0)}") )
.then( -> lcd.setCursor(01) )
.then( -> lcd.cursorUnder() )
.delay(4000)
.then( ->
  = new Date()
  = d.toString()
  return lcd.setCursor(00)
    .then( -> lcd.print(s) )
    .then( -> lcd.setCursor(01) )
    .then( -> lcd.print(s.substring(16)) )
)
.delay(4000)
.then( -> lcd.off() )
.done()

This allows you to drive a 1602 LCD module using only 4 pins on the raspberry pi

Based on: https://github.com/wilberforce/lcd-pcf8574

Install

npm i i2c-lcd

DownloadsWeekly Downloads

7

Version

1.0.2

License

BSD

Last publish

Collaborators

  • avatar
  • avatar