Hello,
I cannot use “lv_led_set_color” on version 8.3
I have created a led:
/Create a ADX_Create_Label_Bool style./ | |
---|---|
lv_style_init(&ADX_style_label_bool_r); | |
lv_style_set_height(&ADX_style_label_bool_r,40); | |
lv_style_set_width(&ADX_style_label_bool_r,40); | |
lv_style_set_bg_color(&ADX_style_label_bool_r,lv_palette_main(LV_PALETTE_GREEN)); | |
lv_style_set_bg_opa(&ADX_style_label_bool_r,255 ); |
and
static lv_obj_t * ADX_Create_Label_Bool(lv_obj_t * parent, lv_style_t * ADX_style, int x, int y, float value, lv_event_cb_t event_cb)
{
/Create label and use the new styles/
static lv_obj_t * Led;
Led = lv_led_create(parent);
lv_obj_remove_style_all(Led); /Remove the styles coming from the theme/
lv_obj_add_style(Led, ADX_style, LV_STATE_DEFAULT);
lv_obj_align(Led, LV_ALIGN_CENTER, 0, 0);
//lv_led_set_color(Led,lv_palette_main(LV_PALETTE_RED));
lv_led_set_brightness(Led, 255);
lv_obj_set_x(Led, x);
lv_obj_set_y(Led, y);
lv_led_on(Led);
return Led;
}
if (*ValueToDisplay==0)
{
lv_led_set_color(led,lv_palette_main(LV_PALETTE_RED));
}
else
{
lv_led_set_color(led,lv_palette_main(LV_PALETTE_GREEN));
}
But the color of the led do not change.
I call lv_task_handler() peridodically.
The other label of the screen are updated.
Thank you for your help
Best regard