Chat freely about anything...

User avatar
By panoss
#80775 I 'm trying to use the ESP8266-12E with a Nokia 5110 LCD screen.
This is the code:

Code: Select all
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>

#define LCD_CLK 3
#define LCD_DIN 1
#define LCD_DC 0
#define LCD_CE 2
#define LCD_RST 10

Adafruit_PCD8544 display = Adafruit_PCD8544(LCD_CLK, LCD_DIN, LCD_DC, LCD_CE, LCD_RST);


But I get this error:
....Adafruit_PCD8544.cpp:187:17: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'PortReg* {aka volatile unsigned char*}' in assignment

clkport = portOutputRegister(digitalPinToPort(_sclk));

^

...Adafruit_PCD8544.cpp:189:17: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'PortReg* {aka volatile unsigned char*}' in assignment

mosiport = portOutputRegister(digitalPinToPort(_din));


What am I doing wrong?

They are connected this way:
ESP............Nokia 5110
GPIO3........CLK
GPIO1........DIN
GPIO0........DC
GPIO2........CE
GPIO10......RST

I 'm programming the ESP in DIO mode.
User avatar
By panoss
#80776 Maybe because I connected CLK and DIN on the wrong pins of the ESP?
I have them this way:
ESP............Nokia 5110
GPIO3........CLK
GPIO1........DIN


Maybe the correct is this(?):
GPIO14......CLK (GPIO14 is the HSPI CLK)
GPIO13......DIN (GPIO13 is the HSPI D)


ESP8266-12E.png
User avatar
By panoss
#80777 Or, maybe I'm using the wrong library.
There is a branch for ESP (I'm using the main branch which is for arduino).

EDIT:
I removed the Adafruit-PCD8544 that I used for Arduino and installed the one from the branch for ESP.
The error is gone, but the LCD does not work, it doesn't diplay anything.
I have connected them this way:
ESP..........LCD
GPIO3......CLK
GPIO1......DIN
GPIO0......DC
GPIO2......CE
GPIO10....RST