I am using an ESP32 with an SD card and a 3.5-inch ILI9488 TFT screen.
My goal is to display images stored on the SD card, and I have a working code snippet. However, I'm wondering which approach is the best for efficiency considering that the images will change every 10 seconds over a 24-hour period. Here are the options I'm considering:
Save the images as JPEG and use a library for JPEG decoding.
Save the images on the SD card as BMP files.
Convert the images to a C-style array and save to sd card and then display that.
or is there any better way
here is code that works with jpg decoder lib
#include <SPI.h>
#include <FS.h>
#include <SD.h>
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
#include <JPEGDecoder.h>
void setup() {
digitalWrite(15, HIGH); // TFT screen chip select
digitalWrite(5, HIGH); // SD card chips select
tft.begin();
if (!SD.begin(5, tft.getSPIinstance())) {
Serial.println("Card Mount Failed");
return;
}
drawSdJpeg("/1.jpg", 0, 0); // This draws a jpeg pulled off the SD Card
}
I want render to be fast and processing time to be fast. So esp not to have lot of effort . Its better for me to prepare image in the way that is easier for esp to show to tft
Utilizing the sketch mentioned at the start of this topic.
Actual file name of the jpeg used:
Lily TTGO T7 V1.3 ESP32 Mini 1.jpg
Error while compiling:
exit status 1
'drawSdJpeg' was not declared in this scope
//https://forum.arduino.cc/t/best-way-to-display-image-on-3-5-tft-screen/1212163
#include <SPI.h>
#include <FS.h>
#include <SD.h>
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
#include <JPEGDecoder.h>
void setup() {
digitalWrite(15, HIGH); // TFT screen chip select
digitalWrite(5, HIGH); // SD card chips select
tft.begin();
if (!SD.begin(5, tft.getSPIinstance())) {
Serial.println("Card Mount Failed");
return;
}
//drawSdJpeg("/1.jpg", 0, 0); // This draws a jpeg pulled off the SD Card
//drawSdJpeg("/Lily TTGO T7 V1.3 ESP32 Mini 1.jpg", 0, 0);
drawSdJpeg("Lily TTGO T7 V1.3 ESP32 Mini 1.jpg", 0, 0);
}
}
``
Did I enter enter the jpeg's name incorrectly?