ESP-32 with tft display I recently got a Adafruit TFT screen and an ESP-32 development kit. I was trying to interface these two the pin connections I used areas follows:

TFT   |   ESP-32
------+----------
3V3   |   Vcc
Gnd   |   Gnd
MOSI  |   GPIO19
SCK   |   GPIO18
CS    |   GPIO5
D/C   |   GPIO16
RST   |   GPIO 17


I used this library: https://github.com/MartyMacGyver/ESP32_Adafruit_ILI9341

The SPI library used was the one that comes while installing Arduino support for ESP-32.

The code compiles and uploads without any error/ warning but the TFT screen does not show any response (except powering up).

This is the code I used for testing:

//#include &lt;Adafruit_ST7735.h&gt;

#include&lt;Adafruit_ILI9341.h&gt;
#include &lt;Adafruit_GFX.h&gt;
#include "SPI.h"


#define TFT_CS     5
#define TFT_RST    17
#define TFT_DC     16

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS ,TFT_DC, 23, 18, TFT_RST);


void setup() {
    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("In the setup.");
    //tft.initR(INITR_BLACKTAB);
    unsigned long t=micros();
    tft.fillScreen(ILI9341_RED);
    Serial.println(micros()-t);
}

void loop() {
    // put your main code here, to run repeatedly:

}


The code compiles and uploads without any error/warning but the TFT screen does not show any response (except powering up).

NOTE: The library works fine with Arduino Mega and TFT display.
Ok, sorry for the delay, I had my exams. But I have finally solved the issue.
There were several issues:


MOSI should be connected to pin 23 not 19.
tft.begin() function should be in the setup to initialize the TFT. (for ILI9341)
The SPI library used should be the one that comes with ESP-32 support. The general SPI library for Arduino does not work with ESP-32.


Note: the ST7735 library currently does not work with ESP-32. It can be made to work by adding the following definitions given bellow to the Adafruit_ST7735.h header file.

    #elif defined(ESP32)
    volatile uint32_t *dataport, *clkport, *csport, *rsport;
    uint32_t  _cs, _rs, _rst, _sid, _sclk,
    datapinmask, clkpinmask, cspinmask, rspinmask,
    colstart, rowstart; 


(add this just after the ESP8266 definitions).