Page 1 of 1

2.8 TFT SPI with Touch

Posted: Wed Mar 18, 2020 8:41 am
by error105
Hi, i just buy 2.8 TFT screen that have touch screen.

I use SPI, but im dont know which library i should use for my touch screen and where i shoul connect pins.

Code: Select all

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
Adafruit_ILI9341 tft = Adafruit_ILI9341(2, 4, 21, 18, 15);


void setup() {

  Serial.begin(115200);
  Serial.println("ILI9341 Test!"); 
 
  tft.begin();
  tft.fillScreen(ILI9341_BLACK);
  
}


void loop() {
  


}
Image

Re: 2.8 TFT SPI with Touch

Posted: Wed Mar 18, 2020 10:31 am
by pipi61
The lcd spi pins and touch spi pins short wire
my pins, but check setting in your used library...

Code: Select all

   ESP | ILI9341 | TOUCH  |
   --------|---------|---------
   GPIO2   | DC      |        |
   GPIO17  |         |   TPCS   |
   GPIOxx  |         |   TIRQ |        none if tft espi lib
   GPIO19  | MISO    |   TDO  |
   GPIO23  | MOSI    |   TDIN |
   GPIO18  | CLK     |   TCK  |
   GPIO15  | lcdCS   |        | 
   GPIO4   | lcdrst   |        | 
   VCC3V3  |BACKL.LED|        |
   VCC3V3  | VCC     |        |
   VCC3V3  | RESET   |        |
   --------|---------|--------- 
-------
try https://github.com/Bodmer/TFT_eSPI/ library, this include touch and spi functions, and examples

Re: 2.8 TFT SPI with Touch

Posted: Wed Mar 18, 2020 12:03 pm
by error105
T_DO, T_DIN, T_CLK i dont know where i shuld wire.
T_CS to CS pin i know :)

Re: 2.8 TFT SPI with Touch

Posted: Wed Mar 18, 2020 1:42 pm
by pipi61

Code: Select all

GPIO19  | MISO    |   T_DO  |
   GPIO23  | MOSI    |   T_DIN |
   GPIO18  | SCK     |   T_CLK  |
   
esp gpio19 connect to miso AND t_do ....
check your photo...