Problems uploading images from png to bin files

I am uploading a converted image from png to bin file.

Image equal to LCD size
I want to output multiple images regularly.
(using timer)
Assume there are 5 images

Q1,
To print image 2 after printing image 1
In image 2, files from "image file 1" to "image file 5" are opened.
(ex)
   Image 2 output command
  
  -> image 3 open
  -> image 4 open
  -> image 5 open
  -> image 1 open
  -> image 2 open

   Image 3 output command
   
  -> image 4 open
  -> image 5 open
  -> image 1 open
  -> image 2 open
  -> image 3 open
   
   
Is it normal operation?



Q2, 
I want to erase the existing screen by repeating irregularly and display the desired image on the screen.
What is the best command?

" lv_obj_move_foreground() "

Is this the best command?

What MCU/Processor/Board and compiler are you using?

TI/AMxx

Code to reproduce

lv_obj_t * img1 = lv_img_create(lv_scr_act(), NULL);
lv_obj_t * img2 = lv_img_create(lv_scr_act(), NULL);
lv_obj_t * img3 = lv_img_create(lv_scr_act(), NULL);
lv_obj_t * img4 = lv_img_create(lv_scr_act(), NULL);
lv_obj_t * img5 = lv_img_create(lv_scr_act(), NULL);

lv_img_set_src(img1, "S:/test_1.bin");
lv_img_set_src(img2, "S:/test_2.bin");
lv_img_set_src(img3, "S:/test_3.bin");
lv_img_set_src(img4, "S:/test_4.bin");
lv_img_set_src(img5, "S:/test_5.bin");

while(1)
{
	lv_obj_move_foreground(img1);
	printf("\n img 1\n");
	ThreadSleep(3000U);

	lv_obj_move_foreground(img2);
	printf("\n img 2\n");
	ThreadSleep(3000U);

	lv_obj_move_foreground(img3);
	printf("\n img 3\n");
	ThreadSleep(3000U);

	lv_obj_move_foreground(img4);
	printf("\n img 4\n");
	ThreadSleep(3000U);

	lv_obj_move_foreground(img5);
	printf("\n img 5\n");
	ThreadSleep(3000U);
}

You can’t delay for 3 seconds with an OS sleep function. You should use an lv_task and flip between images there. Then you should run lv_task_handler every few milliseconds.

I think the porting documentation has an example about this.

1 Like