#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <SdFat.h>
#include <Adafruit_ImageReader.h>
#define SD_CS 4
#define TFT_CS 10
#define TFT_DC 8
#define TFT_RST 9
SdFat SD;
Adafruit_ImageReader reader(SD);
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
Serial.begin(9600);
tft.begin();
if (!SD.begin(SD_CS, SD_SCK_MHZ(25))) {
Serial.println(F("SD begin() failed"));
for (;;);
}
tft.fillScreen(ILI9341_BLUE);
tft.setRotation(3);
ImageReturnCode stat = reader.drawBMP("/wokwi.bmp", tft, 0, 0);
reader.printStatus(stat);
}
void loop() {}