To make the SPI display compatible to the usual Arduino ESP libraries, it is connected like this:
Display | ESP |
LED | 3v3 |
SCK | D5 (SPI CLK) |
SDA SDI MOSI | D7 (SPI MOSI) |
A0 DC RS | D4 |
RESET | D3 |
CS | D2 |
GND | GND |
VCC | 3v3 |
D2, D3 and D4 are defined in the software and can be changed.
Board manager URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json\ Board: NodeMCU 1.0 (ESP-12E Module)
to install:
include:
#include "Adafruit_GFX.h" // include Adafruit graphics library #include "Adafruit_ILI9341.h" // include Adafruit ILI9341 TFT library
initialization:
#define TFT_CS D2 #define TFT_RST D3 #define TFT_DC D4 Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
Start:
tft.begin(); tft.setRotation(3); tft.fillScreen(ILI9341_BLACK); printText(0,0, "Test Text");