lv_fs_file_t f;
lv_fs_res_t res;
res = lv_fs_open(&f, (const char *)"/image.jpg", LV_FS_MODE_WR);
if (res == LV_FS_RES_OK) {
Serial.println("opened");
uint32_t bw; // Number of bytes written
res = lv_fs_write(&f, imageData, sizeof(imageData), &bw);
Serial.println(res);
if (res == LV_FS_RES_OK) {
Serial.print("Data written to file: ");
// Serial.println(data);
Serial.print("Number of bytes written: ");
Serial.println(bw);
} else {
Serial.println("Failed to write to file");
}
}
lv_obj_t *img = lv_img_create(lv_scr_act());
lv_img_set_src(img, &f); // Set the image source
// Adjust the position of the image
lv_obj_set_align(img, LV_ALIGN_CENTER);
lv_fs_close(&f);
this the code i am using
in lv_conf.h
#define LV_USE_FS_LITTLEFS 1
#if LV_USE_FS_LITTLEFS
#define LV_FS_LITTLEFS_LETTER 'D' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#endif
this the error i am getting
lv_fs_open: Can't open file (/image.jpg): unknown driver letter lv_fs.c:75␍␊
[14:23:28:977] [Info]⇥ (0.010, +0)⇥ lv_image_create: begin lv_image.c:123␍␊
[14:23:28:986] [Warn]⇥ (0.010, +0)⇥ lv_image_set_src: failed to get image info: 0x3fcebcf4 lv_image.c:175␍␊
when drive letter passed my code is getting crashed
res = lv_fs_open(&f, (const char *)"D:/image.jpg", LV_FS_MODE_WR);