Use lv_test_lmeter not normal display,but use example obj,line is normal

hi,everyone !


I had a problem using the official example. I’m using the lv_test_line,lv_test_arc,lv_test_obj example, it normal display,but when i using lv_test_lmeter, not can normal display. Is there some configuration parameter in my software wrong?

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


What LVGL version are you using?

LVGL 6.0

What do you want to achieve?

it can noraml display with lmeter examplay

What have you tried so far?

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:

void lv_test_lmeter_1(void)
    /* Create a default object*/
    lv_obj_t * lmeter1 = lv_lmeter_create(lv_disp_get_scr_act(NULL), NULL);
    lv_obj_set_pos(lmeter1, 110, 110);
    lv_lmeter_set_value(lmeter1, 60);

    /*Copy the previous line meter and set smaller size for it*/
    lv_obj_t * lmeter2 = lv_lmeter_create(lv_disp_get_scr_act(NULL), lmeter1);
    lv_obj_set_size(lmeter2, LV_DPI / 2,  LV_DPI / 2);
    lv_obj_align(lmeter2, lmeter1, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);

    /*Create a styled line meter*/
    static lv_style_t style3;
    lv_style_copy(&style3, &lv_style_pretty);
    style3.body.main_color = LV_COLOR_GREEN;
    style3.body.grad_color = LV_COLOR_RED;
    style3.body.padding.left = 4;
    style3.body.border.color = LV_COLOR_GRAY;      /*Means the needle middle*/
    style3.line.width = 2;
    style3.line.color = LV_COLOR_SILVER;

    lv_obj_t * lmeter3 = lv_lmeter_create(lv_disp_get_scr_act(NULL), lmeter1);
    lv_obj_align(lmeter3, lmeter1, LV_ALIGN_OUT_RIGHT_MID, 20, 0);
    lv_obj_set_style(lmeter3, &style3);
    lv_lmeter_set_scale(lmeter3, 270, 41);
    lv_lmeter_set_range(lmeter3, -100, 100);
    lv_lmeter_set_value(lmeter3, 50);

    /*Copy the modified 'lmeter3' and set a smaller size for it*/
    lv_obj_t * lmeter4 = lv_lmeter_create(lv_disp_get_scr_act(NULL), lmeter3);
    lv_obj_set_size(lmeter4, 60, 60);
    lv_obj_align(lmeter4, lmeter3, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);


Screenshot and/or video


can you everyone help? thanks

I’ve tried it in simulator and it work well there. Could you try it on PC as well?

thanks for you answer。im try it on pc as well,but it not normal on mcu

It’s probably a bug in your display driver, then.