I have been working on a project using this board : "Amazon.com" and using TFT_eSPI. Everything has been working fine until i tryed to add wifi. I started using the following includes:
#include <WiFi.h>
#include <WebServer.h>
#include <WebSocketsServer.h>
#include <ArduinoJson.h>
This lead to an error that lead to me uninstalling Arduino, deleting the Arduino 15 folder (C:\Users\david\AppData\Local\Arduino15), and reinstalling Arduino.
This solved the WIFI issue but now TFT is not compiling. I tried going back through all of the setup steps found in this document for arduino: GitHub - Xinyuan-LilyGO/T-Display-S3
I went back to using an example project to see if there was somthing wrong with my code however the example gives the exact same error message wihle trying to compile.
This is the code:
#include "TFT_eSPI.h"
#include "install.h"
TFT_eSPI tft= TFT_eSPI();
TFT_eSprite sprite = TFT_eSprite(&tft);
void setup() {
tft.init();
tft.setRotation(1);
tft.setSwapBytes(true);
tft.fillScreen(TFT_WHITE);
tft.pushImage(106, 0, 214, 170, install);
sprite.createSprite(146,170);
sprite.setTextColor(TFT_BLACK,TFT_WHITE);
sprite.setTextDatum(4);
}
//progress bar variables
int progress=0;
int w=120;
int h=18;
int x=12;
int y=90;
int blocks=0;
void loop() {
sprite.fillSprite(TFT_WHITE);
sprite.setFreeFont(&Orbitron_Light_24);
sprite.drawString("Progress:",75,16);
sprite.setFreeFont(&Orbitron_Light_32);
sprite.drawString(String(progress)+"%",75,54);
progress++;
if(progress==101)
progress=0;
blocks =progress/5;
sprite.drawRoundRect(x,y,w,h,3,TFT_BLACK);
for(int i=0;i<blocks;i++)
sprite.fillRect(i*5+(x+2)+(i*1),y+4,5,10,TFT_BLACK);
sprite.drawRect(10,124,60,22,TFT_BLACK);
sprite.drawRect(76,124,60,22,TFT_BLACK);
sprite.drawString("OK",40,134,2);
sprite.drawString("CANCEL",106,134,2);
sprite.setTextFont(0);
sprite.drawString("Installation almost done!!",80,160);
sprite.pushSprite(0,0);
delay(60);
}
This is the error:
In file included from c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.h:94,
from c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:16:
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c: In member function 'uint8_t TFT_eSPI::readByte()':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:466:20: error: 'GPIO' was not declared in this scope
466 | #define RD_L GPIO.out_w1tc = (1 << TFT_RD)
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c:98:3: note: in expansion of macro 'RD_L'
98 | RD_L;
| ^~~~
In file included from c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:20:
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c:100:9: error: 'gpio_input_get' was not declared in this scope; did you mean 'gpio_num_t'?
100 | reg = gpio_input_get(); // Read three times to allow for bus access time
| ^~~~~~~~~~~~~~
| gpio_num_t
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c: In member function 'void TFT_eSPI::pushBlock(uint16_t, uint32_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c:547:5: note: in expansion of macro 'tft_Write_16'
547 | tft_Write_16(color);
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c:558:23: note: in expansion of macro 'tft_Write_16'
558 | else while (len--) {tft_Write_16(color);}
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c: In member function 'void TFT_eSPI::pushSwapBytePixels(const void*, uint32_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c:568:20: note: in expansion of macro 'tft_Write_16'
568 | while ( len-- ) {tft_Write_16(*data); data++;}
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c: In member function 'void TFT_eSPI::pushPixels(const void*, uint32_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c:578:37: note: in expansion of macro 'tft_Write_16'
578 | if(_swapBytes) { while ( len-- ) {tft_Write_16(*data); data++; } }
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:436:32: note: in expansion of macro 'GPIO_CLR_REG'
436 | #define tft_Write_16S(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.c:579:27: note: in expansion of macro 'tft_Write_16S'
579 | else { while ( len-- ) {tft_Write_16S(*data); data++;} }
| ^~~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'void TFT_eSPI::spiwrite(uint8_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:412:27: note: in expansion of macro 'GPIO_CLR_REG'
412 | #define tft_Write_8(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t)(C)); WR_H
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:950:3: note: in expansion of macro 'tft_Write_8'
950 | tft_Write_8(c);
| ^~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'void TFT_eSPI::writecommand(uint8_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:167:20: error: 'GPIO' was not declared in this scope
167 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:964:3: note: in expansion of macro 'DC_C'
964 | DC_C;
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'void TFT_eSPI::writedata(uint8_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:168:20: error: 'GPIO' was not declared in this scope
168 | #define DC_D GPIO.out_w1ts = (1 << TFT_DC)
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:1012:3: note: in expansion of macro 'DC_D'
1012 | DC_D; // Play safe, but should already be in data mode
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'virtual void TFT_eSPI::drawChar(int32_t, int32_t, uint16_t, uint32_t, uint32_t, uint8_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3167:32: note: in expansion of macro 'tft_Write_16'
3167 | if (column[k] & mask) {tft_Write_16(color);}
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3168:15: note: in expansion of macro 'tft_Write_16'
3168 | else {tft_Write_16(bg);}
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3171:7: note: in expansion of macro 'tft_Write_16'
3171 | tft_Write_16(bg);
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'virtual void TFT_eSPI::setWindow(int32_t, int32_t, int32_t, int32_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:167:20: error: 'GPIO' was not declared in this scope
167 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3419:5: note: in expansion of macro 'DC_C'
3419 | DC_C; tft_Write_8(TFT_CASET);
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'void TFT_eSPI::readAddrWindow(int32_t, int32_t, int32_t, int32_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:167:20: error: 'GPIO' was not declared in this scope
167 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3495:3: note: in expansion of macro 'DC_C'
3495 | DC_C; tft_Write_8(TFT_CASET);
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'virtual void TFT_eSPI::drawPixel(int32_t, int32_t, uint32_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:167:20: error: 'GPIO' was not declared in this scope
167 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3677:7: note: in expansion of macro 'DC_C'
3677 | DC_C; tft_Write_8(TFT_CASET);
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:167:20: error: 'GPIO' was not declared in this scope
167 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3684:7: note: in expansion of macro 'DC_C'
3684 | DC_C; tft_Write_8(TFT_PASET);
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:167:20: error: 'GPIO' was not declared in this scope
167 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3690:3: note: in expansion of macro 'DC_C'
3690 | DC_C; tft_Write_8(TFT_RAMWR);
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'virtual void TFT_eSPI::pushColor(uint16_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:625:25: note: in expansion of macro 'tft_Write_16'
625 | #define tft_Write_16N tft_Write_16
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3711:3: note: in expansion of macro 'tft_Write_16N'
3711 | tft_Write_16N(color);
| ^~~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'virtual int16_t TFT_eSPI::drawChar(uint16_t, int32_t, int32_t, uint8_t)':
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:5250:31: note: in expansion of macro 'tft_Write_16'
5250 | if (line & mask) {tft_Write_16(textcolor);}
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:5251:19: note: in expansion of macro 'tft_Write_16'
5251 | else {tft_Write_16(textbgcolor);}
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:5256:18: note: in expansion of macro 'tft_Write_16'
5256 | if (pX) {tft_Write_16(textbgcolor);}
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:5305:30: note: in expansion of macro 'tft_Write_16'
5305 | while (tnp--) {tft_Write_16(textcolor);}
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:356:26: error: 'GPIO' was not declared in this scope
356 | #define GPIO_CLR_REG GPIO.out1_w1tc.val
| ^~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32_S3.h:432:31: note: in expansion of macro 'GPIO_CLR_REG'
432 | #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \
| ^~~~~~~~~~~~
c:\Users\david\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:5307:19: note: in expansion of macro 'tft_Write_16'
5307 | else {tft_Write_16(textcolor);}
| ^~~~~~~~~~~~
exit status 1
Compilation error: exit status 1
Any help with this will be greatly appricated!