PCD8544 LCD driver (Nokia 5110)
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:
- The display needs initialising each time the power is applied - so if you're planning on saving your code, put
.connect
in theonInit()
function. - The display takes around 100ms to initialise after calling 'connect'. There's an optional callback that is called after this time (shown in the example). Sending data to it before initialisation may cause it not to initialise correctly.
- This module uses a double buffer, which means you need to call
g.flip()
before any changes take effect. - The display seems picky about lower SPI baud rates - try and keep above 1Mhz in
SPI.setup
- You can use
g.setContrast(0.45)
to set the contrast of the LCD display. It takes a value between0
and1
-0.5
is the default.
Using
![Pocket 'walking' GPS Pocket 'walking' GPS](refimages/tutorials_Pocket_Walking_GPS_thumb.png)
![Flappy Bird Game Flappy Bird Game](refimages/tutorials_Pico_Flappy_Bird_Game_thumb.png)
![Wireless Temperature Sensor Wireless Temperature Sensor](refimages/tutorials_Wireless_Temperature_Sensor_thumb.png)
![Pico Clock Pico Clock](refimages/tutorials_Pico_Clock_thumb.png)
![Soldering an LCD directly to Espruino Soldering an LCD directly to Espruino](refimages/tutorials_Onboard_LCD_thumb.png)
![Snake Game Snake Game](refimages/tutorials_Snake_thumb.png)
![5 Minute Wire Loop Game 5 Minute Wire Loop Game](refimages/tutorials_Pico_Wire_Loop_Game_thumb.png)
![Pico Weather Station Pico Weather Station](refimages/tutorials_Pico_Weather_Station_thumb.png)
![Pico LCD Display Hello World Pico LCD Display Hello World](refimages/tutorials_Pico_LCD_Hello_World_thumb.png)
![Pico Electronic Dice Pico Electronic Dice](refimages/tutorials_Pico_Electronic_Dice_thumb.png)
![Controlling Pico from a Computer Controlling Pico from a Computer](refimages/tutorials_Pico_CPU_Monitor_thumb.png)
![AA/AAA Battery Charger AA/AAA Battery Charger](refimages/tutorials_Battery_Charger_thumb.png)
![WiFi Xively Humidity/Temperature Sensor with Display WiFi Xively Humidity/Temperature Sensor with Display](refimages/examples_wifi_humidity_thumb.png)
![Temperature Graph on a PCD8544 display, with DS18B20 temperature sensor Temperature Graph on a PCD8544 display, with DS18B20 temperature sensor](refimages/no_thumb.png)
![Temperature on a PCD8544 display, with DS18B20 temperature sensor Temperature on a PCD8544 display, with DS18B20 temperature sensor](refimages/no_thumb.png)
![HTTP Image Loader HTTP Image Loader](refimages/no_thumb.png)
Buying
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.