Hi, I'm trying to make a Nokia 5110 lcd display with 8 pins work with an ESP32 LOLIN S2 Mini. I think I got the pins confused. Or maybe it's about the library because looking at exemples in the library they always refer to the 5 pin version.
Right now, the serial monitor doesn't show anything but the display lights up.
the pins on the nokia
1-vcc
2-gnd
3-sce
4-rst
5-d/c
6-dn(mosi)
7-sclk
8-led
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
// Pin configuration
#define RST_PIN 6
#define CE_PIN 5
#define DC_PIN 7
#define DIN_PIN 11
#define CLK_PIN 12
#define LED_PIN 3
// Create an instance of the LCD
Adafruit_PCD8544 display = Adafruit_PCD8544(CE_PIN, DC_PIN, DIN_PIN, CLK_PIN, RST_PIN);
void setup() {
Serial.begin(115200);
Serial.println("Starting setup...");
// Initialize the LCD
Serial.println("Initializing LCD...");
display.begin();
Serial.println("LCD begin() done.");
Serial.println("Setting contrast...");
display.setContrast(60); // Adjust contrast if needed
Serial.println("Contrast set.");
Serial.println("Clearing display...");
display.clearDisplay();
Serial.println("Display cleared.");
// Turn on the backlight
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
Serial.println("Backlight turned on.");
Serial.println("LCD initialized. Displaying message.");
display.setTextSize(1);
display.setTextColor(BLACK);
display.setCursor(0, 0);
display.print("Hello, ESP32!");
display.display();
Serial.println("Message displayed.");
}
void loop() {
// Add code here for further operations
}
Any help is appreciated,
Thank you