Problem is as the title states. The code goes through, but for some reason it won't display on the screen even though the screen works when testing it using Adafruit's example sketches. I also know nothing about code and was just following a video.
#include <SPI.h>
#include <TFT_eSPI.h>
#include <AnimatedGIF.h>
AnimatedGIF gif;
#include "homer.h"
#define SCLK_PIN GPIO_NUM_18
#define MOSI_PIN GPIO_NUM_23
#define DC_PIN GPIO_NUM_2
#define CS_PIN GPIO_NUM_0
#define RST_PIN GPIO_NUM_4
TFT_eSPI tft = TFT_eSPI();
#define imageWidth 128
#define imageHeight 64
#define GIF_IMAGE homer
//#define USE_DMA // ESP32 ~1.25x single frame rendering performance boost for badgers.h
// Note: Do not use SPI DMA if reading GIF images from SPI SD card on same bus as TFT
#define NORMAL_SPEED // Comment out for rame rate for render speed test
void setup() {
Serial.begin(9600);
Serial.println("ESP32 is starting up");
Serial.println("TFT screen initialising");
tft.begin();
#ifdef USE_DMA
tft.initDMA();
#endif
tft.fillScreen(TFT_BLACK);
gif.begin(BIG_ENDIAN_PIXELS);
//tft.setRotation(1);
Serial.println("Image has been rendered onto screen");
}
void loop() {
if (gif.open((uint8_t *)GIF_IMAGE, sizeof(GIF_IMAGE), GIFDraw))
{
Serial.printf("Successfully opened GIF; Canvas size = %d x %d\n", gif.getCanvasWidth(), gif.getCanvasHeight());
tft.startWrite(); // The TFT chip select is locked low
while (gif.playFrame(true, NULL))
{
yield();
}
gif.close();
tft.endWrite(); // Release TFT chip select for other SPI devices
}
}