Move dot on display based on acceleration

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

STM32F7

What LVGL version are you using?

9.2

What do you want to achieve?

Hi all, I’m new to LVGL and I’m building an acceleration/ G-Force gauge. I want to be able to move the red dot on the display (as below) based on the acceleration measured.

What have you tried so far?

I have tried just a simple test where I move the dot back and forth using lv_obj_set_pos() function but for some reason the dot only remains in one place and does not switch between the two.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

  lv_init();
  lv_tick_set_cb(HAL_GetTick);
  lv_display_t* display = lv_display_create(480, 480);
  lv_display_set_buffers(display, (void*) 0xC007A120, NULL, 480*480*2, LV_DISP_RENDER_MODE_DIRECT);
  lv_display_set_flush_cb(display, my_flush_cb);

  ui_init();
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
	  lv_timer_handler_run_in_period(5);
	  lv_obj_set_pos(objects.obj8, 100, 100);
	  lv_obj_set_pos(objects.obj8, 300, 300);
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
  }
  /* USER CODE END 3 */

This is just a snippet from the main function. I have verified that the flushing all works correctly but for some reason the dot just moves to (300,300) and stays there.

Screenshot and/or video

This is what the UI looks like.

Thanks in advance!

in order to see the movement of the point it is necessary to add a noticeable delay between the position settings