Description
Im getting this error error: 'ui' was not declared in this scope lv_label_set_text(ui.BGPOS, labelValue);
What MCU/Processor/Board and compiler are you using?
esp32
What LVGL version are you using?
8.4
What do you want to achieve?
pass a value from the encoder to the label BGPOS
What have you tried so far?
IVe entered the following code to pass the value to the BGPOS label to display, this is in ui.h
Code to reproduce
// Read the encoder position
int encoderPos = encoder.read() / 4; // Adjust for ppi (256) of the encoder
// Convert the encoder position to millimeters
float pitch = 100.0; // Pitch in millimeters per pulse
float encoderPos_mm = encoderPos * pitch;
// Update the label with the new position
char labelValue[16];
sprintf(labelValue, “BGPOS: %.1f mm”, encoderPos_mm);
lv_label_set_text(ui.BGPOS, labelValue);
I get `i\ui.ino:143:21: error: ‘ui’ was not declared in this scope
lv_label_set_text(ui.BGPOS, labelValue);
^~
exit status 1
Compilation error: ‘ui’ was not declared in this scope`