/joy-it-RB-LCD-20x4

Accessing the LCD and input buttons of the RB-LCD-20x4 display by joy-it

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

joy-it-RB-LCD-20x4

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.

Setup

  1. Plug in the display-shield to your raspberry pi like shown in user manuals.
  2. 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.
  3. 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
  4. Install this library with npm install --save joy-it-rb-lcd-20x4
  5. Run an example script

Example

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();
})();

Supported Displays

RB-LCD-20x4

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

product image of the RB-LCD-20x4

RB-LCD-16x2

The RB-LCD-16x2 should also work but support is untested.

Unsupported joy-it displays

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.

Displays without an i2c adapter are not supported at all by this class of libraries. These are for example:

License

This library is released under the GPL-3.0-or-later license.