Hello, I have been working on a project using an ESP32 and a TFT LCD display with touchscreen for arduino uno. This is the display I use.
I need to use WiFi at the same time so I modified the user_setup.h file to remove and adc2 pins.
The display has no issue in the actual display part, but I am having some trouble with the touchscreen. I can read only 1 axis off it, because it doesn't work with the TFT_eSPI touchscreen read function. My LCD_RD pin is connected to 3.3v, I tried to connect it to D32, but I didn't notice any change.
Here is my code that I use to test the reading for the 1 axis:
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
int Y() {
int y = 0;
pinMode(27, OUTPUT); digitalWrite(27, HIGH);
pinMode(13, OUTPUT); digitalWrite(13, LOW);
pinMode(14, INPUT);
pinMode(26, INPUT);
delay(5);
for (int i = 0; i <= 20; i++) {
y += analogRead(35);
delay(2);
}
pinMode(26, OUTPUT);
pinMode(14, OUTPUT);
pinMode(27, OUTPUT);
pinMode(13, OUTPUT);
delay(5);
return y / 400;
}
void setup() {
tft.init();
tft.setTextSize(2);
tft.fillScreen(TFT_BLACK);
}
void loop() {
tft.setCursor(0, 0);
int y = Y();
tft.print(y);
delay(250);
}
Here is my user_setup.h:
#define ILI9341_DRIVER
#define ESP32_PARALLEL
#define TFT_RST 23
#define TFT_CS 25
#define TFT_DC 26
#define TFT_WR 27
#define TFT_D0 13
#define TFT_D1 14
#define TFT_D2 16
#define TFT_D3 17
#define TFT_D4 18
#define TFT_D5 19
#define TFT_D6 21
#define TFT_D7 22
#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 20000000
#define SPI_READ_FREQUENCY 20000000
I need some help to make the X axis work.
I also made a PCB for the current version, only the esp32 connected to the display. I do not use the SD card.
