I created a new topic a few days ago in another category (probably the wrong one?). Now I have improved my code, but I still can’t see my image.
I have been coding for the last 5 years (privately and in a higher technical school in Austria) in several languages, but this display is my final enemy.
Description
What MCU/Processor/Board and compiler are you using?
ESP32-S3-Touch-LCD-5 from Waveshare; Arduino IDE
What LVGL version are you using?
8.4
What do you want to achieve?
showing an image from the tf-card on the screen
What have you tried so far?
showing an image, which is stored on the esp32 as c-array: worked well. But for more than 2 pictures there is too little memory on the esp32.
That the image, i want from the tf-card, is shown in the Serial Monitor:
Listing directory: /System Volume Information
FILE: Panel_bmp.bmp SIZE: 180054
Code to reproduce
I am using waveshare_sd_card.h
SPI.setHwCs(false);
SPI.begin(SD_CLK, SD_MISO, SD_MOSI, SD_SS);
if (!SD.begin()) {
Serial.println("Card Mount Failed"); // SD card mounting failed
return;
}
uint8_t cardType = SD.cardType();
if (cardType == CARD_NONE) {
Serial.println("No SD card attached"); // No SD card connected
return;
}
Serial.print("SD Card Type: "); // SD card type
if (cardType == CARD_MMC) {
Serial.println("MMC");
} else if (cardType == CARD_SD) {
Serial.println("SDSC");
} else if (cardType == CARD_SDHC) {
Serial.println("SDHC");
} else {
Serial.println("UNKNOWN"); // Unknown Type
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
Serial.printf("SD Card Size: %lluMB\n", cardSize);
void lv_example_image_2(lv_obj_t * parent)
{
Serial.println("Hello");
listDir(SD, "/", 1); // Listet alle Dateien im Root-Verzeichnis auf
lv_obj_t * img = lv_img_create(parent);
lv_img_set_src(img, "/Panel_bmp.bmp");
lv_obj_align(img, LV_ALIGN_CENTER, 0, 80);
}
I can see sd Card Type, Hello and the Listing directory (panel_bmp.bmp) in SerialMonitor.
But the screen remains white.
Screenshot and/or video
The things you can see in the picture is my tabview, in which i want to see the image
lv_example_image_2(tab1);
I appreciate any help.