rpi-ili9341-lcd
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

npm

rpi-ili9341-lcd

A Raspberry Pi display driver for LCDs running the ILI9341 chip, like the Waveshare 2.4inch LCD Module.

Installation

⚠️ This package was designed to be used with the rpio library for Node.js.
Please make sure that you have rpio installed and set-up according to its system requirements.

  npm install rpio
  npm install rpi-ili9341-lcd

Getting started

You need to pass the bitmap of the image you want to display to the showImage() method.
Here's a simple example that fills the entire display with a single color. See the Examples section for more advanced usages.

const rpio = require("rpio");
const { ILI9341_LCD } = require('rpi-ili9341-lcd');

const color = [0xff, 0x00, 0xff];  //magenta #FF00FF

rpio.init({ mapping: "gpio", gpiomem: false });
const disp = new ILI9341_LCD(rpio, { width: 240, height: 320 });

disp.Init();
disp.clear();
disp.showImage({
  width: 240,
  height: 320,
  data: Buffer.alloc(240 * 320 * 3, Buffer.from(color))
});
disp.moduleExit();

Examples

FAQ

What LCD models does this library support?

It was only tested on the Waveshare 2.4inch LCD Module because it's the only ILI9341-based display that I own.
Please open an issue if you need support for a different model.

Which GPIO pin should each pin on the LCD be connected to?

See the "Raspberry Pi Guides" section here to learn how to connect your LCD to the Raspberry Pi, but as listed in the FAQ section there, do not connect the BL pin.

How was this code written?

This code was ported from the Python version here

I'm getting a Cannot find module 'rpio' error when trying to run the example code. What should I do?

This library depends on rpio as a peerDependency. Make sure that you have it installed and set-up according to its system requirements.

Running Tests

To run tests, run the following command

  npm run test

License

MIT

Package Sidebar

Install

npm i rpi-ili9341-lcd

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

20.5 kB

Total Files

5

Last publish

Collaborators

  • cowchimp