Hello
I don’t really understand the principle of LVGL yet.
The demo lv_demo_music() I got so far to run.
Now I’m trying to move a red circle on top of this demo on a touch interrupt, see code below (this is just for testing purposes). Unfortunately this does not work properly, see video-link below. Where does this effect come from, or what did I get wrong here?
https://drive.google.com/file/d/1yXwN8hApzJChUUlnUZjIAJjTX2_r1SIf/view?usp=sharing
static lv_obj_t * my_Cir;
uint16_t xpos1=0, ypos1=0;
...
...
void setup()
{
.....
//GUI
lv_demo_music();
//static lv_obj_t * my_Cir = lv_obj_create(lv_scr_act());
my_Cir = lv_obj_create(lv_scr_act());
lv_obj_set_scrollbar_mode(my_Cir , LV_SCROLLBAR_MODE_OFF);
lv_obj_set_size(my_Cir , 42, 42);
lv_obj_set_pos(my_Cir, 100, 100);
lv_obj_set_style_bg_color(my_Cir , lv_palette_lighten(LV_PALETTE_RED, 3), 0);
lv_obj_set_style_radius(my_Cir , LV_RADIUS_CIRCLE, 0);
}
void loop()
{
lv_timer_handler(); /* let the GUI do its work */
delay( 5 );
// move circle
if(touched){
lv_obj_set_pos(my_Cir, xpos1++, ypos1++);
}
}