What do you want to achieve?
I have a ESP 32 display and i created a tab view. after some time on the UI breaks from my screen
What have you tried so far?
Screenshot or video
void setup() {
Serial.begin(115200);
Serial.println(“Starting setup…”);
// Set the start time
startMillis = millis();
ESP_Panel *panel = new ESP_Panel();
Serial.println("Initializing panel...");
panel->init();
#if LVGL_PORT_AVOID_TEAR
ESP_PanelBus_RGB *rgb_bus = static_cast<ESP_PanelBus_RGB *>(panel->getLcd()->getBus());
rgb_bus->configRgbFrameBufferNumber(LVGL_PORT_DISP_BUFFER_NUM);
rgb_bus->configRgbBounceBufferSize(LVGL_PORT_RGB_BOUNCE_BUFFER_SIZE);
#endif
panel->begin();
Serial.println(“Initializing LVGL port…”);
lvgl_port_init(panel->getLcd(), panel->getTouch());
lvgl_port_lock(-1);
ui_init();
// Initialize the chart series from UI
chart_series = lv_chart_add_series(ui_Chart1, lv_color_hex(0xC52039), LV_CHART_AXIS_PRIMARY_Y);
lvgl_port_unlock();
Serial.println("Setup complete.");
}
void loop() {
unsigned long currentMillis = millis();
//lv_task_handler();
// Update labels every second
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
update_labels();
update_chart(); // Update the chart at each interval
}
// Update time and date every second
if (currentMillis - lastTimeUpdateMillis >= timeUpdateInterval) {
lastTimeUpdateMillis = currentMillis;
update_time_and_date();
}
}
this is the setup and loop code i am using. to avoid the breakage of the UI should i be implementing something else please let me know.
Others
- SquareLine Studio version:
- Operating system:
- Target hardware: