zwei arcs werden angezeigt
This commit is contained in:
@@ -117,16 +117,19 @@ void setValuetoArc(ARC arc, float value) {
|
||||
|
||||
sprintf(s,"name: %s, value: %.1f, green: %d, yellow: %d", arc.name, arc.value, arc.green, arc.yellow);
|
||||
Serial.println(s);
|
||||
static lv_style_t style_arc;
|
||||
lv_style_init(&style_arc);
|
||||
static lv_style_t st_arc;
|
||||
lv_style_init(&st_arc);
|
||||
if (arc.value < arc.green) {
|
||||
lv_style_set_arc_color(&style_arc, lv_palette_main(LV_PALETTE_GREEN));
|
||||
lv_style_set_arc_color(&st_arc, lv_palette_main(LV_PALETTE_GREEN));
|
||||
Serial.println("green");
|
||||
} else if (arc.value < arc.yellow) {
|
||||
lv_style_set_arc_color(&style_arc, lv_palette_main(LV_PALETTE_YELLOW));
|
||||
lv_style_set_arc_color(&st_arc, lv_palette_main(LV_PALETTE_YELLOW));
|
||||
Serial.println("yellow");
|
||||
} else {
|
||||
lv_style_set_arc_color(&style_arc, lv_palette_main(LV_PALETTE_RED));
|
||||
}
|
||||
lv_obj_add_style(arc.arc, &style_arc, LV_PART_INDICATOR);
|
||||
lv_style_set_arc_color(&st_arc, lv_palette_main(LV_PALETTE_RED));
|
||||
Serial.println("red");
|
||||
}
|
||||
lv_obj_add_style(arc.arc, &st_arc, LV_PART_INDICATOR);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user