This is a monochome LCD display driver typically used in the Nokia 5110 LCD display (84x48), but also the 5120, 5130, 5160, 6110, 6150, 3210, 3310, 3315, 3330, 3350, 3410 and 6210. The LCDs are available (pre-mounted on PCBs) cheaply from via various suppliers online.
They draw very small amounts of power - around 200uA - making them extremely good for use in battery powered devices.
Support is included in the PCD8544 (About Modules) module, using the Graphics library.
Just wire up as follows:
LCD pin | Pin type | Example pin on Espruino Board |
---|---|---|
GND | GND | GND |
LIGHT | Any | GND (backlight on) |
VCC | 3.3v | 3.3 |
CLK | SPI SCK | B3 |
DIN | SPI MOSI | B5 |
DC | Any | B6 |
CE | Any | B7 |
RST | Any | B8 |
SPI1.setup({ sck:B3, mosi:B5 });
var g = require("PCD8544").connect(SPI1, B6 /*DC*/, B7 /*CE*/, B8 /*RST*/, function() {
g.clear();
g.drawString("Hello",0,0);
g.drawLine(0,10,84,10);
g.flip();
});
Note:
.connect
in the onInit()
function.g.flip()
before any changes take effect.SPI.setup
g.setContrast(0.45)
to set the contrast of the LCD display. It takes a value between 0
and 1
- 0.5
is the default.This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.