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);
|
sprintf(s,"name: %s, value: %.1f, green: %d, yellow: %d", arc.name, arc.value, arc.green, arc.yellow);
|
||||||
Serial.println(s);
|
Serial.println(s);
|
||||||
static lv_style_t style_arc;
|
static lv_style_t st_arc;
|
||||||
lv_style_init(&style_arc);
|
lv_style_init(&st_arc);
|
||||||
if (arc.value < arc.green) {
|
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) {
|
} 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 {
|
} else {
|
||||||
lv_style_set_arc_color(&style_arc, lv_palette_main(LV_PALETTE_RED));
|
lv_style_set_arc_color(&st_arc, lv_palette_main(LV_PALETTE_RED));
|
||||||
|
Serial.println("red");
|
||||||
}
|
}
|
||||||
lv_obj_add_style(arc.arc, &style_arc, LV_PART_INDICATOR);
|
lv_obj_add_style(arc.arc, &st_arc, LV_PART_INDICATOR);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ typedef struct {
|
|||||||
int highvalue;
|
int highvalue;
|
||||||
int green;
|
int green;
|
||||||
int yellow;
|
int yellow;
|
||||||
|
lv_style_t style_arc;
|
||||||
|
lv_style_t style_label;
|
||||||
|
lv_style_t lv_style_value_label;
|
||||||
|
|
||||||
} ARC;
|
} ARC;
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ void setup() {
|
|||||||
Serial.println("Main GUI created");
|
Serial.println("Main GUI created");
|
||||||
|
|
||||||
setValuetoArc(arcTemp, 25.3);
|
setValuetoArc(arcTemp, 25.3);
|
||||||
setValuetoArc(arcHum, 45.0);
|
// setValuetoArc(arcHum, 45.0);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
// Start WiFi
|
// Start WiFi
|
||||||
connectToWifi();
|
connectToWifi();
|
||||||
|
|||||||
Reference in New Issue
Block a user