Here is an example. Only commenting or uncommenting #include “AtWiFi.h” stops the Sprite working.
#include"TFT_eSPI.h"
#include"Free_Fonts.h" //include the header file
#include “AtWiFi.h”
TFT_eSPI tft = TFT_eSPI(); // Declare object “tft”
TFT_eSprite spr = TFT_eSprite(&tft); // Declare Sprite object “spr” with pointer to “tft” object
int humi;
void setup()
{
tft.init();
tft.fillScreen(TFT_BLUE);
tft.setRotation(3);
tft.setFreeFont(FSS12); //select Free, Sans
tft.drawString(“Startup tft”,0,5);//prints string
delay(1000);
spr.createSprite(320, 240);// Create a sprite of defined size
spr.setFreeFont(FSS24); //select Free, Sans
spr.drawString(“Startup Sprite”,0,50);//prints string
spr.pushSprite(0, 0);//52ms
delay(1000);
}
void loop()
{
humi++;
spr.drawString("humi: " + String(humi) + " ",0,5);//prints string
spr.pushSprite(0, 0);//52ms
delay(1000);
}