Maybe it should but in fact not.
Just connecting a Nokia5110 to the Pico.
SCK to pin B13
MOSI to B15
D/C to B10
RST to B1
SCE to B14 or A8
GND to GND
VCC to 3.3V
This code gives a blank screen
B14.write(1); //CS_LCD
var g;
var MONTHS = [
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"
];
function draw() {
g.clear();
var t = new Date();
var date = t.getDate()+" "+MONTHS[t.getMonth()]+" "+t.getFullYear();
var time = t.getHours()+":" +
("0"+t.getMinutes()).substr(-2);
var secs = ("0"+t.getSeconds()).substr(-2);
// top left date
g.setFontBitmap();
g.drawString(date,0,0);
// middle time
g.setFontVector(20);
var timeWidth = g.stringWidth(time);
g.drawString(time,(g.getWidth()-timeWidth-12)/2,10);
// seconds over to the right
g.setFontBitmap();
g.drawString(secs,(g.getWidth()+timeWidth-8)/2,26);
// send to LCD
g.flip();
}
function onInit() {
clearInterval();
// Setup SPI
//var spi = new SPI();
SPI2.setup({ sck:B13, mosi:B15});
// Initialise the LCD
// connect(/*=SPI*/_spi, /*=PIN*/_dc, /*=PIN*/_ce, /*=PIN*/_rst, callback)
g = require("PCD8544").connect(SPI2,B10,B14,B1, function() {
// When it's initialised, set up an animation at 1fps (1s per frame)
setInterval(draw, 1000);
});
}
onInit();
and this one works as expected
A8.write(1); //CS_LCD
var g;
var MONTHS = [
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"
];
function draw() {
g.clear();
var t = new Date();
var date = t.getDate()+" "+MONTHS[t.getMonth()]+" "+t.getFullYear();
var time = t.getHours()+":" +
("0"+t.getMinutes()).substr(-2);
var secs = ("0"+t.getSeconds()).substr(-2);
// top left date
g.setFontBitmap();
g.drawString(date,0,0);
// middle time
g.setFontVector(20);
var timeWidth = g.stringWidth(time);
g.drawString(time,(g.getWidth()-timeWidth-12)/2,10);
// seconds over to the right
g.setFontBitmap();
g.drawString(secs,(g.getWidth()+timeWidth-8)/2,26);
// send to LCD
g.flip();
}
function onInit() {
clearInterval();
// Setup SPI
//var spi = new SPI();
SPI2.setup({ sck:B13, mosi:B15});
// Initialise the LCD
// connect(/*=SPI*/_spi, /*=PIN*/_dc, /*=PIN*/_ce, /*=PIN*/_rst, callback)
g = require("PCD8544").connect(SPI2,B10,A8,B1, function() {
// When it's initialised, set up an animation at 1fps (1s per frame)
setInterval(draw, 1000);
});
}
onInit();
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Maybe it should but in fact not.
Just connecting a Nokia5110 to the Pico.
SCK to pin B13
MOSI to B15
D/C to B10
RST to B1
SCE to B14 or A8
GND to GND
VCC to 3.3V
This code gives a blank screen
and this one works as expected
I have updated my Pico to 1V80