Hi everyone,
I have been reading the forum for a while but this is my first post. I'm currently working on a project where I repurpose parts from a Senseo coffee machine and control them via an ESP32. The system is already fully functional using a web interface, but I also want to add an control option via a touch panel.
For this, I chose the Waveshare 1.28" Touch LCD (Wiki link). However, I am unable to get it working when using the LC-Relay-ESP32-2R-D5 module as my ESP32 board (Wiki-Link).
My wiring setup:
Module Pin | ESP32 Pin
VCC 5V
GND GND
MISO GPIO19 (VSPIQ)
MOSI GPIO23 (VSPID)
SCLK GPIO18 (VSPICLK)
LCS_CS GPIO5 (VSPICS0)
LCS_DC GPIO21
LCS_RST GPIO17
LCS_BL GPIO16
TP_SDA GPIO21 (I2C SDA)
TP_SCL GPIO22 (I2C SCL)
TP_INT GPIO4
TP_RST GPIO2
My test code:
#include <SPI.h>
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("SPI-Test...");
// Standard VSPI-Pins for ESP32
SPI.begin(30, 31, 37, 28); // SCLK, MISO, MOSI, CS
delay(100);
Serial.println("SPI started!");
// Backlight activation
pinMode(27, OUTPUT);
digitalWrite(27, HIGH);
// Initialize display
tft.init();
tft.setRotation(1);
tft.fillScreen(TFT_RED);
delay(1000);
tft.fillScreen(TFT_GREEN);
delay(1000);
tft.fillScreen(TFT_BLUE);
delay(1000);
}
void loop() {}
My User_Setups/Setup200_GC9A01.h configuration:
#define USER_SETUP_ID 200
#define GC9A01_DRIVER
#define TFT_MOSI 37
#define TFT_MISO 31
#define TFT_SCLK 30
#define TFT_CS 29
#define TFT_DC 33
#define TFT_RST 38
#define LOAD_GLCD
#define LOAD_FONT2
#define LOAD_FONT4
#define LOAD_FONT6
#define LOAD_FONT7
#define LOAD_FONT8
#define LOAD_GFXFF
#define SMOOTH_FONT
#define SPI_FREQUENCY 27000000
#define SPI_READ_FREQUENCY 5000000
Issue:
Despite this setup, I cannot get the display to work. The screen remains blank, and I don’t see any output from the test code.
Questions:
- Is there an issue with the pin mapping when using the LC-Relay-ESP32-2R-D5 module?
- Could the SPI configuration in my code be incorrect?
- Where do I define the pins for the touch functions?
- Has anyone successfully used this display with an ESP32-based relay module like mine?
Any help would be greatly appreciated!
