I am trying to make my ESP8266 microprocessor draw and display graphics on an ILI9341 TFT display with a no touch screen.
I am using an Adafruit Graphics Demo sketch for this purpose.
This sketch compiles and uploads to the ESP8266 just fine. The sketch then writes text and calculated elapsed times onto the Serial Monitor. However the ILI9341 screen displays no graphics.
When I try to set the ESP8266 RST Pin LOW in the sketch, I get the following error message associated with the command, digitalWrite(TFT_RST,HIGH):
exit status 1
expected constructor, destructor, or type conversion before '(' token
I don't understand this message, and, consequently I don't know what to do to solve this problem.
The top portion of this sketch follows:
// ##############################################################################
// #
// # Sketch: ESP8266_ILI9341_Adafruit_demo_ESP8266_Pin_Mgmt_12_22_23
// #
// # Interfacing ESP8266 NodeMCU V3 with ILI9341 No Touch TFT display (240x320 pixel).
// #
// # Microprocessor: LoLin NodeMCU V3
// # Board Model Used: Generic ESP8266 Module
// # Display: ILI9341 2.8 Inch TFT SPI 240x320 No Touch Screen
// #
// # Pin Connections
// #
// # TFT SPI ILI9341
// # Pins ESP8266 Wire
// # # Label Pin Color
// # 1 VCC -------- VCC Red
// # 2 GND -------- GND Black
// # 3 CS -------- D2 Brown
// # 4 RST -------- D3 Red
// # 5 D/C -------- D4 Orange
// # 6 MOSI -------- D7 Yellow
// # 7 SCK -------- D5 Green
// # 8 BL -------- VCC Blue
// #
// ##############################################################################
#define ILI9341_DRIVER
#include <Adafruit_GFX.h> // include Adafruit graphics library
#include <Adafruit_ILI9341.h> // include Adafruit ILI9341 TFT library
#define TFT_CS 2 // TFT CS pin is connected to NodeMCU pin D2
#define TFT_RST 3 // TFT RST pin is connected to NodeMCU pin D3
#define TFT_DC 4 // TFT DC pin is connected to NodeMCU pin D4
#define TFT_MOSI 7
#define TFT_SCK 5
#define TFT_MISO 6
int delayTime = 500;
Adafruit_ILI9341 tft = Adafruit_ILI9341 (TFT_CS, TFT_DC, TFT_RST);
pinMode(TFT_RST,OUTPUT);
// Try to turn the RST Pin LOW and then HIGH
digitalWrite(TFT_RST,LOW);
delay(100);
digitalWrite(TFT_RST,HIGH);
void setup() {
Serial.begin (9600);
Serial.println ("ILI9341 Test!");
tft.begin();
What am I doing wrong?