20 lines
556 B
C++
20 lines
556 B
C++
// kopiere in die jeweils entsprechenden Funktionen in ui.ino
|
|
|
|
// um analogRead benutzen zu können, muss man das Board "Pico (Arduino MBED)" auswählen
|
|
|
|
void setup(){
|
|
}
|
|
|
|
void loop(){
|
|
int moisture_raw = analogRead(A0);
|
|
int moisture_mapped = map(moisture_raw, 800, 300, 0, 100);
|
|
int moisture = constrain(moisture_mapped, 0, 100);
|
|
|
|
// Label (oder andere Text-Elemente)
|
|
lv_label_set_text(ui_Label1, String(moisture).c_str());
|
|
|
|
// Bar / Arc (alles mit Werten)
|
|
lv_bar_set_value(ui_Bar1, moisture, LV_ANIM_ON); // oder LV_ANIM_OFF
|
|
}
|
|
|