This is JavaScript/TypeScript library to access the LCD and input buttons of special LC-displays. Supported are some displays by joy-it with a PCF8574/PCF8574AT i2c adapter chip.
- Plug in the display-shield to your raspberry pi like shown in user manuals.
- To access the display you first need to enable the i2c kernel module using
raspi-config
. Have a look in the manual (links below) for details. - install node.js on the raspberry pi e.g. by using the official install script:
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - && sudo apt install nodejs -y
- Install this library with
npm install --save joy-it-rb-lcd-20x4
- Run an example script
import { JoyItLCD } from 'joy-it-rb-lcd-20x4';
let lcd;
async function initLCD() {
lcd = new JoyItLCD();
await lcd.initialize();
await lcd.clear();
}
async function sayHello() {
await lcd.printLine(0, '********************');
await lcd.printLine(1, '******* HELLO ******');
await lcd.printLine(2, '******* WORLD ******');
await lcd.printLine(3, '********************');
}
(async () => {
await initLCD();
await sayHello();
})();
The RB-LCD-20x4 is a green monochrome 20x4 character LC-display with 4 additional buttons.
Pin: 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
Hex: 80 | 40 | 20 | 10 | 08 | 04 | 02 | 01
Use: EN | - | RW | RS | D7 | D6 | D5 | D4
The RB-LCD-16x2 should also work but support is untested.
While this library could be used to access other displays with a PCF8574/PCF8574AT i2c adapter chip we recommend to use the raspberrypi-liquid-crystal library to access these displays.
- SBC-LCD16x2 - I2C Serial 2.6“ LCD Module
- SBC-LCD20x4 - I2C Serial 20x4 2004 LCD Module
Displays without an i2c adapter are not supported at all by this class of libraries. These are for example:
This library is released under the GPL-3.0-or-later license.