Pointer (or something else?) to LVGL widget

Hi,
I am writing my first Arduino code for a Lilygo T-Watch 2021 and I want the program to:

  1. receive a button input (one click or two clicks);
  2. look at the RTC time when the input is received;
  3. based on the RTC time, identify one of 48 LVGL arc widgets, corresponding each to a 15-minute slot out of a 12-hour period;
  4. based on the number of clicks (one or two), change the color of that widget to red or green.

I am trying, without success so far, to use some kind of "pointer" to the LVGL widget, that I can associate to a specific widget (out of the 48 I created) to later change its color to red or green based on the number of button clicks.
Unfortunately I am having a hard time understanding the concept of pointer and I am not even sure a pointer is the solution to do what I have in mind.

I am going to paste here only the parts of the code I am interested in, hoping to keep the post easier to read, because I am still working on other parts and they are pretty messy right now.
All the code below is in the void.loop() section, because the button input can occur several times:

lv_obj_t * ui_Arc_pointer;
This is the supposed "pointer" (?) I created. The type to be asociated should be lv_object_t, but I am not even sure it is a valid type.

if (time_seconds >= 0 && time_seconds < 15*60) ui_Arc_pointer = ui_Arc2;
else if (time_seconds >= 15*60 && time_seconds < 30*60) ui_Arc_pointer = ui_Arc3;
else if (time_seconds >= 30*60 && time_seconds < 45*60) ui_Arc_pointer = ui_Arc4;

This above is the part (just the first 3 of 48 time slots) where I compare the RTC time with 48 fixed 15' time slots (I made a function that converts Hour:Minute time into seconds) and associate the "pointer" to one of the 48 actual arc widget.

lv_obj_set_style_arc_color(ui_Arc_pointer, lv_color_hex(0x40FF4B), LV_PART_MAIN);
And finally this is the part where I change the color of the "ui_Arc_pointer" if the button is clicked once. Same thing with different color if there are two clicks.

I have played around with the "*" adding and removing it before ui_Arc_pointer, and the syntax above is the only one that compiles without errors. However, it seems to work but when I press the button the serial monitor prints the following:

Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

And it reboots.
I am sure my code isn't written correctly to do what I want, but after a couple of days of banging my head at it I wasn't able to come up with a better idea.
Can anybody give me some precious advise?
Thanks in advance
Angelo

You should already have a point to the arc widget when you created it.
Show your code where the arc is created.

    /*Add green arc for normal*/
    static lv_meter_indicator_t * indicator = lv_meter_add_arc(meter, scale, 3, okColor, 0);

In the snippet above, indicator is a green arc within a meter widget. You should have something similar? Just use the variable that the arc was assigned to.

Thanks @cedarlakeinstruments, i used SquareLine Studio to create the GUI. If I go on any ot the arc widgets and right click "go to definition", it sends me to the file named ui.h.
That’s where I took lv_obj_t thinking this is the correct “type” for the widget.
Here is the content:

// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.3.1
// LVGL version: 8.3.6
// Project name: Face_v5_allgrey
#ifndef _FACE_V5_ALLGREY_UI_H
#define _FACE_V5_ALLGREY_UI_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined __has_include
#if __has_include("lvgl.h")
#include "lvgl.h"
#elif __has_include("lvgl/lvgl.h")
#include "lvgl/lvgl.h"
#else
#include "lvgl.h"
#endif
#else
#include "lvgl.h"
#endif
#include "ui_helpers.h"
#include "ui_events.h"
// SCREEN: ui_Screen1
void ui_Screen1_screen_init(void);
extern lv_obj_t * ui_Screen1;
extern lv_obj_t * ui_Arc2;
extern lv_obj_t * ui_Arc1;
extern lv_obj_t * ui_Arc3;
extern lv_obj_t * ui_Arc4;
extern lv_obj_t * ui_Arc5;
extern lv_obj_t * ui_Arc6;
extern lv_obj_t * ui_Arc7;
extern lv_obj_t * ui_Arc8;
extern lv_obj_t * ui_Arc9;
extern lv_obj_t * ui_Arc10;
extern lv_obj_t * ui_Arc11;
extern lv_obj_t * ui_Arc12;
extern lv_obj_t * ui_Arc13;
extern lv_obj_t * ui_Arc14;
extern lv_obj_t * ui_Arc15;
extern lv_obj_t * ui_Arc16;
extern lv_obj_t * ui_Arc17;
extern lv_obj_t * ui_Arc18;
extern lv_obj_t * ui_Arc19;
extern lv_obj_t * ui_Arc20;
extern lv_obj_t * ui_Arc21;
extern lv_obj_t * ui_Arc22;
extern lv_obj_t * ui_Arc23;
extern lv_obj_t * ui_Arc24;
extern lv_obj_t * ui_Arc25;
extern lv_obj_t * ui_Arc26;
extern lv_obj_t * ui_Arc27;
extern lv_obj_t * ui_Arc28;
extern lv_obj_t * ui_Arc29;
extern lv_obj_t * ui_Arc30;
extern lv_obj_t * ui_Arc31;
extern lv_obj_t * ui_Arc32;
extern lv_obj_t * ui_Arc33;
extern lv_obj_t * ui_Arc34;
extern lv_obj_t * ui_Arc35;
extern lv_obj_t * ui_Arc36;
extern lv_obj_t * ui_Arc37;
extern lv_obj_t * ui_Arc38;
extern lv_obj_t * ui_Arc39;
extern lv_obj_t * ui_Arc40;
extern lv_obj_t * ui_Arc41;
extern lv_obj_t * ui_Arc42;
extern lv_obj_t * ui_Arc43;
extern lv_obj_t * ui_Arc44;
extern lv_obj_t * ui_Arc45;
extern lv_obj_t * ui_Arc46;
extern lv_obj_t * ui_Arc47;
extern lv_obj_t * ui_Arc48;
extern lv_obj_t * ui_Label2;
extern lv_obj_t * ui_Label1;
extern lv_obj_t * ui_Label3;
extern lv_obj_t * ui_Label4;
extern lv_obj_t * ui_Label5;
extern lv_obj_t * ui_Label6;
extern lv_obj_t * ui_Label7;
extern lv_obj_t * ui_Label8;
extern lv_obj_t * ui_Label9;
extern lv_obj_t * ui_Label10;
extern lv_obj_t * ui_Label11;
extern lv_obj_t * ui_Label12;
extern lv_obj_t * ui_Label14;
extern lv_obj_t * ui____initial_actions0;
void ui_init(void);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif

In addition to that I have a ui_Screen1.c file where all the features of each arc are defined:

ui_Arc2 = lv_arc_create(ui_Screen1);
    lv_obj_set_width(ui_Arc2, 230);
    lv_obj_set_height(ui_Arc2, 230);
    lv_obj_set_align(ui_Arc2, LV_ALIGN_CENTER);
    lv_arc_set_range(ui_Arc2, 0, 0);
    lv_arc_set_bg_angles(ui_Arc2, 359, 1);
    lv_arc_set_rotation(ui_Arc2, 270);
    lv_obj_set_style_arc_color(ui_Arc2, lv_color_hex(0x979B97), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_arc_opa(ui_Arc2, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_arc_width(ui_Arc2, 20, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_arc_rounded(ui_Arc2, false, LV_PART_MAIN | LV_STATE_DEFAULT);

    lv_obj_set_style_arc_color(ui_Arc2, lv_color_hex(0xFEFEFE), LV_PART_INDICATOR | LV_STATE_DEFAULT);
    lv_obj_set_style_arc_opa(ui_Arc2, 255, LV_PART_INDICATOR | LV_STATE_DEFAULT);
    lv_obj_set_style_arc_width(ui_Arc2, 0, LV_PART_INDICATOR | LV_STATE_DEFAULT);

    lv_obj_set_style_bg_color(ui_Arc2, lv_color_hex(0xFFFFFF), LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui_Arc2, 255, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_color(ui_Arc2, lv_color_hex(0xFFFFFF), LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_main_stop(ui_Arc2, 0, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_stop(ui_Arc2, 255, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui_Arc2, LV_GRAD_DIR_NONE, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_blend_mode(ui_Arc2, LV_BLEND_MODE_MULTIPLY, LV_PART_KNOB | LV_STATE_DEFAULT);

Neither of these looks exactly like yours... I am confused...

Since ui_Arc_pointer and ui_Arc2 are both of type 'lv_obj_t *' that usage is indeed correct.

The exception dump gives a lot more information than that. Run the dump through the ESP Exception Decoder to get the final execution trace. From the 'LoadProhibited' message, I'd guess you're de-referencing an invalid pointer.

1 Like

It looks like ui_Arc2 is indeed the reference you need.

I haven't used Squareline studio but the problem may be that ui_Arc2 is not valid when you try to use it.

To check that assumption, test ui_Arc_pointer. e.g.,

if (ui_Arc_pointer != nullptr)
{
  lv_obj_set_style_arc_color(ui_Arc_pointer, lv_color_hex(0x40FF4B), LV_PART_MAIN);
}

If it stops crashing with this addition, it means that your reference to ui_Arc2 is not valid (something probably nulled the pointer before you accessed it)

1 Like

@gfvalvo, @cedarlakeinstruments, thanks a lot! I will try your suggestions ASAP and let you know!

@gfvalvo, @cedarlakeinstruments, here is an update: I installed the ESP Exception Decoder (I had to install an older version of Arduino IDE first, because versions after 2. are not supported Exception decoder - #2 by cattledog), and ran the dump through it. It did show me all the dependencies where conflicts were encountered, it was very nice, even if I wasn't able to trace everything, but it was enough to confirm that I had made mistakes in the pointer syntax.
The best part is that your indication that my approach was correct put me on the right track to look better at pointer assignment and dereferencing, and I was able to find the right syntax to make the pointer work as needed.
Here are the new snippets:

lv_obj_t * *ui_Arc_pointer;
I guess the first * is part of the type definition (still not sure what it means), while the second * is part of the pointer...

if (time_seconds >= 0 && time_seconds < 15*60) ui_Arc_pointer=&ui_Arc2; // metto l'indirizzo di ui_Arc2 nel puntatore
else if (time_seconds >= 15*60 && time_seconds < 30*60) ui_Arc_pointer=&ui_Arc1;
else if (time_seconds >= 30*60 && time_seconds < 45*60) ui_Arc_pointer=&ui_Arc3;

lv_obj_set_style_arc_color(*ui_Arc_pointer, lv_color_hex(0x40FF4B), LV_PART_MAIN);

Thanks a lot guys!
Angelo

What you have now is just adding another level of indirection through the pointer to a pointer. It's functionally equivalent to what you had before. I think there was either something else different / wrong in your original code or there's still a mismanaged pointer lurking somewhere that will eventually show itself.

Hmmmm...
@gfvalvo, based on your comment, I tried to remove one of the two * and move the remaining * left, right or center:

lv_obj_t * ui_Arc_pointer;

lv_obj_t* ui_Arc_pointer;

lv_obj_t *ui_Arc_pointer;

In all cases I get the following compilation error:
cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment

Post the complete code (or a smaller, complete example). It's too hard to mentally piece together what you did from just disjoint snippets and a verbal description.

Here it is. I started from an LVGL example taken from the Arduino GFX library. I tried to clean as much as I could. Hope it is readable...

/*******************************************************************************
 * LVGL Hello World
 * This is a simple example for LVGL - Light and Versatile Graphics Library
 * import from: https://github.com/lvgl/lv_demos.git
 *
 * Dependent libraries:
 * LVGL: https://github.com/lvgl/lvgl.git
 *
 * LVGL Configuration file:
 * Copy your_arduino_path/libraries/lvgl/lv_conf_template.h
 * to your_arduino_path/libraries/lv_conf.h
 * 
 * In lv_conf.h around line 15, enable config file:
 * #if 1 // Set it to "1" to enable content
 * 
 * Then find and set:
 * #define LV_COLOR_DEPTH     16
 * #define LV_TICK_CUSTOM     1
 *
 * For SPI/parallel 8 display set color swap can be faster, parallel 16/RGB screen don't swap!
 * #define LV_COLOR_16_SWAP   1 // for SPI and parallel 8
 * #define LV_COLOR_16_SWAP   0 // for parallel 16 and RGB
 ******************************************************************************/
#include <lvgl.h>
#include "ui.h"
#include <Wire.h> // AGGIUNTO
#include "pcf8563.h" // AGGIUNTO

PCF8563_Class rtc; // AGGIUNTO

#include <Arduino_GFX_Library.h>

#define GFX_BL 21 // default backlight pin, you may replace DF_GFX_BL to actual backlight pin

/* More dev device declaration: https://github.com/moononournation/Arduino_GFX/wiki/Dev-Device-Declaration */
#if defined(DISPLAY_DEV_KIT)
Arduino_GFX *gfx = create_default_Arduino_GFX();
#else /* !defined(DISPLAY_DEV_KIT) */

/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
Arduino_DataBus *bus = new Arduino_ESP32SPI(19 /* DC */, 15 /* CS */, 14 /* SCK */, 13 /* MOSI */, GFX_NOT_DEFINED /* MISO */);

/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
Arduino_GFX *gfx = new Arduino_GC9A01(bus, 27 /* RST */, 0 /* rotation */, true /* IPS */);

#endif /* !defined(DISPLAY_DEV_KIT) */
/*******************************************************************************
 * End of Arduino_GFX setting
 ******************************************************************************/

/* Change to your screen resolution */
static uint32_t screenWidth;
static uint32_t screenHeight;
static lv_disp_draw_buf_t draw_buf;
static lv_color_t *disp_draw_buf;
static lv_disp_drv_t disp_drv;

/* Display flushing */
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
  uint32_t w = (area->x2 - area->x1 + 1);
  uint32_t h = (area->y2 - area->y1 + 1);

#if (LV_COLOR_16_SWAP != 0)
  gfx->draw16bitBeRGBBitmap(area->x1, area->y1, (uint16_t *)&color_p->full, w, h);
#else
  gfx->draw16bitRGBBitmap(area->x1, area->y1, (uint16_t *)&color_p->full, w, h);
#endif

  lv_disp_flush_ready(disp);
}

long go_buzz_1;  // AGGIUNTO
long end_buzz_1; // AGGIUNTO
long go_buzz_2;  // AGGIUNTO
long end_buzz_2; // AGGIUNTO
long go_buzz_3;  // AGGIUNTO
long end_buzz_3; // AGGIUNTO
long go_buzz_4;  // AGGIUNTO
long end_buzz_4; // AGGIUNTO
long delta;      // AGGIUNTO
long start_time; // AGGIUNTO
long timer;      // AGGIUNTO 

// convert time in seconds
int32_t secondsFromHoursMinutes(const char* from) {
return (atoi(from) * 60L + atoi(from + 3)) * 60;
}


void setup()
{
  Serial.begin(115200);
  

#ifdef GFX_EXTRA_PRE_INIT
  GFX_EXTRA_PRE_INIT();
#endif

  // Init Display
  if (!gfx->begin())
  {
    Serial.println("gfx->begin() failed!");
  }
  gfx->fillScreen(BLACK);

#ifdef GFX_BL
  pinMode(GFX_BL, OUTPUT);
  digitalWrite(GFX_BL, HIGH);
#endif

  lv_init();

  screenWidth = gfx->width();
  screenHeight = gfx->height();
#ifdef ESP32
  disp_draw_buf = (lv_color_t *)heap_caps_malloc(sizeof(lv_color_t) * screenWidth * 40, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
#else
  disp_draw_buf = (lv_color_t *)malloc(sizeof(lv_color_t) * screenWidth * 40);
#endif
  if (!disp_draw_buf)
  {
    Serial.println("LVGL disp_draw_buf allocate failed!");
  }
  else
  {
    lv_disp_draw_buf_init(&draw_buf, disp_draw_buf, NULL, screenWidth * 40);

    /* Initialize the display */
    lv_disp_drv_init(&disp_drv);
    /* Change the following line to your display resolution */
    disp_drv.hor_res = screenWidth;
    disp_drv.ver_res = screenHeight;
    disp_drv.flush_cb = my_disp_flush;
    disp_drv.draw_buf = &draw_buf;
    lv_disp_drv_register(&disp_drv);

    /* Initialize the (dummy) input device driver */
    static lv_indev_drv_t indev_drv;
    lv_indev_drv_init(&indev_drv);
    indev_drv.type = LV_INDEV_TYPE_POINTER;
    lv_indev_drv_register(&indev_drv);

  }

  /* initialize Squareline Studio UI */
  ui_init();

  Serial.println("Setup done");
  
  /* INITIALIZE RTC */
  Wire.begin(26, 25);   
  rtc.begin();  
  // rtc.setDateTime(2023, 8, 16, 02, 49, 00);  // commented out to hold time
  
  /* SETTA IL PIN DEL MOTORE COME OUTPUT e btn2 come input */
  pinMode(4, OUTPUT);
  pinMode(35, INPUT_PULLUP);
    
  /* SETTA RANDOM TIMER */ 
  randomSeed(analogRead(17));  // DA PINOUT IL 17 SEMBRA NON USATO
  go_buzz_1 = random(1000, 801000);
  end_buzz_1 = go_buzz_1 + 2000;
  go_buzz_2 = go_buzz_1 + 4000;
  end_buzz_2 = go_buzz_1 + 6000;
  go_buzz_3 = go_buzz_1 + 4000;
  end_buzz_3 = go_buzz_1 + 4300;
  go_buzz_4 = go_buzz_1 + 6000;
  end_buzz_4 = go_buzz_1 + 6300;

  delta = 900000 - (end_buzz_4 + 90000);

  start_time = millis();  // definisce start time come il tempo attuale 

  Serial.println(go_buzz_1);
  Serial.println(end_buzz_1);
  Serial.println(go_buzz_2);
  Serial.println(end_buzz_2);

}

void loop()
{
  lv_timer_handler(); /* let the GUI do its work */
  delay(5);
  Serial.println(rtc.formatDateTime(PCF_TIMEFORMAT_YYYY_MM_DD_H_M_S));  
  delay(1000);  
  lv_label_set_text(ui_Label14, rtc.formatDateTime(PCF_TIMEFORMAT_HM));
  
  /* POINTER TO LVGL ARC WIDGET */ 

  lv_obj_t * *ui_Arc_pointer;  

  int32_t time_seconds = secondsFromHoursMinutes(rtc.formatDateTime(PCF_TIMEFORMAT_HM));
  Serial.println("prove:");
  Serial.println(rtc.formatDateTime(PCF_TIMEFORMAT_HM));
  Serial.println(atoi(rtc.formatDateTime(PCF_TIMEFORMAT_HM))); // TO CHECK TIME CONVERSION TO SEC
  Serial.println(atoi(rtc.formatDateTime(PCF_TIMEFORMAT_HM + 3))); // TO CHECK TIME CONVERSION TO SEC
  Serial.println(time_seconds);  // TO CHECK TIME CONVERSION TO SEC
  

  if (time_seconds >= 12*60*60) time_seconds = (time_seconds-12*60*60); // convert time to 12h
  if (time_seconds >= 0 && time_seconds < 15*60) ui_Arc_pointer=&ui_Arc2; // store ui_Arc2 address into pointer
  else if (time_seconds >= 15*60 && time_seconds < 30*60) ui_Arc_pointer=&ui_Arc1;  
  else if (time_seconds >= 30*60 && time_seconds < 45*60) ui_Arc_pointer=&ui_Arc3;
  else if (time_seconds >= 45*60 && time_seconds < 60*60) ui_Arc_pointer=&ui_Arc4;
  else if (time_seconds >= 60*60 && time_seconds < 75*60) ui_Arc_pointer=&ui_Arc5;
  else if (time_seconds >= 75*60 && time_seconds < 90*60) ui_Arc_pointer=&ui_Arc6;
  else if (time_seconds >= 90*60 && time_seconds < 105*60) ui_Arc_pointer=&ui_Arc7;
  else if (time_seconds >= 105*60 && time_seconds < 120*60) ui_Arc_pointer=&ui_Arc8;
  else if (time_seconds >= 120*60 && time_seconds < 135*60) ui_Arc_pointer=&ui_Arc9;
  else if (time_seconds >= 135*60 && time_seconds < 150*60) ui_Arc_pointer=&ui_Arc10;
  else if (time_seconds >= 150*60 && time_seconds < 165*60) ui_Arc_pointer=&ui_Arc11;
  else if (time_seconds >= 165*60 && time_seconds < 180*60) ui_Arc_pointer=&ui_Arc12;
  else if (time_seconds >= 180*60 && time_seconds < 195*60) ui_Arc_pointer=&ui_Arc13;
  else if (time_seconds >= 195*60 && time_seconds < 210*60) ui_Arc_pointer=&ui_Arc14;
  else if (time_seconds >= 210*60 && time_seconds < 225*60) ui_Arc_pointer=&ui_Arc15;
  else if (time_seconds >= 225*60 && time_seconds < 240*60) ui_Arc_pointer=&ui_Arc16;
  else if (time_seconds >= 240*60 && time_seconds < 255*60) ui_Arc_pointer=&ui_Arc17;
  else if (time_seconds >= 255*60 && time_seconds < 270*60) ui_Arc_pointer=&ui_Arc18;
  else if (time_seconds >= 270*60 && time_seconds < 285*60) ui_Arc_pointer=&ui_Arc19;
  else if (time_seconds >= 285*60 && time_seconds < 300*60) ui_Arc_pointer=&ui_Arc20;
  else if (time_seconds >= 300*60 && time_seconds < 315*60) ui_Arc_pointer=&ui_Arc21;
  else if (time_seconds >= 315*60 && time_seconds < 330*60) ui_Arc_pointer=&ui_Arc22;
  else if (time_seconds >= 330*60 && time_seconds < 345*60) ui_Arc_pointer=&ui_Arc23;
  else if (time_seconds >= 345*60 && time_seconds < 360*60) ui_Arc_pointer=&ui_Arc24;
  else if (time_seconds >= 360*60 && time_seconds < 375*60) ui_Arc_pointer=&ui_Arc25;
  else if (time_seconds >= 375*60 && time_seconds < 390*60) ui_Arc_pointer=&ui_Arc26;
  else if (time_seconds >= 390*60 && time_seconds < 405*60) ui_Arc_pointer=&ui_Arc27;
  else if (time_seconds >= 390*60 && time_seconds < 405*60) ui_Arc_pointer=&ui_Arc27;
  else if (time_seconds >= 405*60 && time_seconds < 420*60) ui_Arc_pointer=&ui_Arc28;
  else if (time_seconds >= 420*60 && time_seconds < 435*60) ui_Arc_pointer=&ui_Arc29;
  else if (time_seconds >= 435*60 && time_seconds < 450*60) ui_Arc_pointer=&ui_Arc30;
  else if (time_seconds >= 450*60 && time_seconds < 465*60) ui_Arc_pointer=&ui_Arc31;
  else if (time_seconds >= 465*60 && time_seconds < 480*60) ui_Arc_pointer=&ui_Arc32;
  else if (time_seconds >= 480*60 && time_seconds < 495*60) ui_Arc_pointer=&ui_Arc33;
  else if (time_seconds >= 495*60 && time_seconds < 510*60) ui_Arc_pointer=&ui_Arc34;
  else if (time_seconds >= 510*60 && time_seconds < 525*60) ui_Arc_pointer=&ui_Arc35;
  else if (time_seconds >= 525*60 && time_seconds < 540*60) ui_Arc_pointer=&ui_Arc36;
  else if (time_seconds >= 540*60 && time_seconds < 555*60) ui_Arc_pointer=&ui_Arc37;
  else if (time_seconds >= 555*60 && time_seconds < 570*60) ui_Arc_pointer=&ui_Arc38;
  else if (time_seconds >= 570*60 && time_seconds < 585*60) ui_Arc_pointer=&ui_Arc39;
  else if (time_seconds >= 585*60 && time_seconds < 600*60) ui_Arc_pointer=&ui_Arc40;
  else if (time_seconds >= 600*60 && time_seconds < 615*60) ui_Arc_pointer=&ui_Arc41;
  else if (time_seconds >= 615*60 && time_seconds < 630*60) ui_Arc_pointer=&ui_Arc42;
  else if (time_seconds >= 630*60 && time_seconds < 645*60) ui_Arc_pointer=&ui_Arc43;
  else if (time_seconds >= 645*60 && time_seconds < 660*60) ui_Arc_pointer=&ui_Arc44;
  else if (time_seconds >= 660*60 && time_seconds < 675*60) ui_Arc_pointer=&ui_Arc45;
  else if (time_seconds >= 675*60 && time_seconds < 690*60) ui_Arc_pointer=&ui_Arc46;
  else if (time_seconds >= 690*60 && time_seconds < 705*60) ui_Arc_pointer=&ui_Arc47;
  else if (time_seconds >= 705*60 && time_seconds < 720*60) ui_Arc_pointer=&ui_Arc48;


  timer = millis() - start_time;

  if (timer >= go_buzz_1 && timer < end_buzz_1) 
  { 
   digitalWrite(4, HIGH);
   Serial.println("buzz on 1"); 

  }
  else if (timer >= end_buzz_1 && timer < go_buzz_2) 
  { 
   digitalWrite(4, LOW);
   Serial.println("buzz off 1"); 

  }
  else if (timer >= go_buzz_2 && timer < end_buzz_2) 
  { 
   digitalWrite(4, HIGH);
   Serial.println("buzz on 2"); 

  }
  else if (timer >= end_buzz_2 && timer < end_buzz_2 + 90000) 
  { 
   digitalWrite(4, LOW);
   Serial.println("buzz off 2"); 
   if (digitalRead(35) == LOW)  // if button pressed once set the arc color to green (still need to add the case of button pressed twice)
   { 
    lv_obj_set_style_arc_color(*ui_Arc_pointer, lv_color_hex(0x40FF4B), LV_PART_MAIN);
   }
  }
  else if (timer >= 900000)  // after 15 minutes reset and restart 
  {
    start_time = millis();
    go_buzz_1 = random(1000, 801000);
    end_buzz_1 = go_buzz_1 + 2000;
    go_buzz_2 = go_buzz_1 + 4000;
    end_buzz_2 = go_buzz_1 + 6000;
    Serial.println(go_buzz_1);
    Serial.println(end_buzz_1);
    Serial.println(go_buzz_2);
    Serial.println(end_buzz_2);
  }

}

Is that the one that compiles or the one with the error from your Post #9? If the former, post the latter along with the complete error message (it will actually show the line with the error).

So, if we go all the way back to the beginning, your syntax was correct. The system was crashing, but clearly the code compiled.

Without seeing the crash dump, I have no idea what happened, but most likely candidate is referencing a bad pointer, which is why I suggested you check the pointer copy before deref.

One other potential problem is the parameters used. You are doing

lv_obj_set_style_arc_color(ui_Arc_pointer, lv_color_hex(0x40FF4B), LV_PART_MAIN);

but the sample is using

lv_obj_set_style_arc_color(ui_Arc2, lv_color_hex(0x979B97), LV_PART_MAIN | LV_STATE_DEFAULT);

Note the LV_STATE_DEFAULT.
I can't say what the difference is without doing more research, but I do remember spending long nights getting working code from LVGL because of minor parameter changes, so I'd suggest you follow their lead.

The full code at my post #11 is the one that compiles and seems to work (i.e. it changes the color of the right arc widget at the right time, with some minor hiccups that don't seem related to the pointer). It has the syntax with the double * *:

lv_obj_t * *ui_Arc_pointer;

Are you saying that there must be a mistake somewhere because the double * * is not a correct syntax in principle?

It's a valid syntax, but defining a pointer to a pointer just so you can de-reference it back to the pointer makes little sense.

Post the complete code that give the following error message from your Post #9

This is the code that produces the error. It's identical to the one I posted before, except at the beginning of void.loop() this line has only one *.

lv_obj_t *ui_Arc_pointer;

The error is the same with the * adjacent to the t, to the u, or beween spaces.
Sorry I haven't found out a way to paste code with line numbers

/*******************************************************************************
 * LVGL Hello World
 * This is a simple example for LVGL - Light and Versatile Graphics Library
 * import from: https://github.com/lvgl/lv_demos.git
 *
 * Dependent libraries:
 * LVGL: https://github.com/lvgl/lvgl.git
 *
 * LVGL Configuration file:
 * Copy your_arduino_path/libraries/lvgl/lv_conf_template.h
 * to your_arduino_path/libraries/lv_conf.h
 * 
 * In lv_conf.h around line 15, enable config file:
 * #if 1 // Set it to "1" to enable content
 * 
 * Then find and set:
 * #define LV_COLOR_DEPTH     16
 * #define LV_TICK_CUSTOM     1
 *
 * For SPI/parallel 8 display set color swap can be faster, parallel 16/RGB screen don't swap!
 * #define LV_COLOR_16_SWAP   1 // for SPI and parallel 8
 * #define LV_COLOR_16_SWAP   0 // for parallel 16 and RGB
 ******************************************************************************/
#include <lvgl.h>
#include "ui.h"
#include <Wire.h> // AGGIUNTO
#include "pcf8563.h" // AGGIUNTO

PCF8563_Class rtc; // AGGIUNTO

#include <Arduino_GFX_Library.h>

#define GFX_BL 21 // default backlight pin, you may replace DF_GFX_BL to actual backlight pin

/* More dev device declaration: https://github.com/moononournation/Arduino_GFX/wiki/Dev-Device-Declaration */
#if defined(DISPLAY_DEV_KIT)
Arduino_GFX *gfx = create_default_Arduino_GFX();
#else /* !defined(DISPLAY_DEV_KIT) */

/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
Arduino_DataBus *bus = new Arduino_ESP32SPI(19 /* DC */, 15 /* CS */, 14 /* SCK */, 13 /* MOSI */, GFX_NOT_DEFINED /* MISO */);

/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
Arduino_GFX *gfx = new Arduino_GC9A01(bus, 27 /* RST */, 0 /* rotation */, true /* IPS */);

#endif /* !defined(DISPLAY_DEV_KIT) */
/*******************************************************************************
 * End of Arduino_GFX setting
 ******************************************************************************/

/* Change to your screen resolution */
static uint32_t screenWidth;
static uint32_t screenHeight;
static lv_disp_draw_buf_t draw_buf;
static lv_color_t *disp_draw_buf;
static lv_disp_drv_t disp_drv;

/* Display flushing */
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
  uint32_t w = (area->x2 - area->x1 + 1);
  uint32_t h = (area->y2 - area->y1 + 1);

#if (LV_COLOR_16_SWAP != 0)
  gfx->draw16bitBeRGBBitmap(area->x1, area->y1, (uint16_t *)&color_p->full, w, h);
#else
  gfx->draw16bitRGBBitmap(area->x1, area->y1, (uint16_t *)&color_p->full, w, h);
#endif

  lv_disp_flush_ready(disp);
}

long go_buzz_1;  // AGGIUNTO
long end_buzz_1; // AGGIUNTO
long go_buzz_2;  // AGGIUNTO
long end_buzz_2; // AGGIUNTO
long go_buzz_3;  // AGGIUNTO
long end_buzz_3; // AGGIUNTO
long go_buzz_4;  // AGGIUNTO
long end_buzz_4; // AGGIUNTO
long delta;      // AGGIUNTO
long start_time; // AGGIUNTO
long timer;      // AGGIUNTO 

// convert time in seconds
int32_t secondsFromHoursMinutes(const char* from) {
return (atoi(from) * 60L + atoi(from + 3)) * 60;
}


void setup()
{
  Serial.begin(115200);
  

#ifdef GFX_EXTRA_PRE_INIT
  GFX_EXTRA_PRE_INIT();
#endif

  // Init Display
  if (!gfx->begin())
  {
    Serial.println("gfx->begin() failed!");
  }
  gfx->fillScreen(BLACK);

#ifdef GFX_BL
  pinMode(GFX_BL, OUTPUT);
  digitalWrite(GFX_BL, HIGH);
#endif

  lv_init();

  screenWidth = gfx->width();
  screenHeight = gfx->height();
#ifdef ESP32
  disp_draw_buf = (lv_color_t *)heap_caps_malloc(sizeof(lv_color_t) * screenWidth * 40, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
#else
  disp_draw_buf = (lv_color_t *)malloc(sizeof(lv_color_t) * screenWidth * 40);
#endif
  if (!disp_draw_buf)
  {
    Serial.println("LVGL disp_draw_buf allocate failed!");
  }
  else
  {
    lv_disp_draw_buf_init(&draw_buf, disp_draw_buf, NULL, screenWidth * 40);

    /* Initialize the display */
    lv_disp_drv_init(&disp_drv);
    /* Change the following line to your display resolution */
    disp_drv.hor_res = screenWidth;
    disp_drv.ver_res = screenHeight;
    disp_drv.flush_cb = my_disp_flush;
    disp_drv.draw_buf = &draw_buf;
    lv_disp_drv_register(&disp_drv);

    /* Initialize the (dummy) input device driver */
    static lv_indev_drv_t indev_drv;
    lv_indev_drv_init(&indev_drv);
    indev_drv.type = LV_INDEV_TYPE_POINTER;
    lv_indev_drv_register(&indev_drv);

  }

  /* initialize Squareline Studio UI */
  ui_init();

  Serial.println("Setup done");
  
  /* INITIALIZE RTC */
  Wire.begin(26, 25);   
  rtc.begin();  
  // rtc.setDateTime(2023, 8, 16, 02, 49, 00);  // commented out to hold time
  
  /* SETTA IL PIN DEL MOTORE COME OUTPUT e btn2 come input */
  pinMode(4, OUTPUT);
  pinMode(35, INPUT_PULLUP);
    
  /* SETTA RANDOM TIMER */ 
  randomSeed(analogRead(17));  // DA PINOUT IL 17 SEMBRA NON USATO
  go_buzz_1 = random(1000, 801000);
  end_buzz_1 = go_buzz_1 + 2000;
  go_buzz_2 = go_buzz_1 + 4000;
  end_buzz_2 = go_buzz_1 + 6000;
  go_buzz_3 = go_buzz_1 + 4000;
  end_buzz_3 = go_buzz_1 + 4300;
  go_buzz_4 = go_buzz_1 + 6000;
  end_buzz_4 = go_buzz_1 + 6300;

  delta = 900000 - (end_buzz_4 + 90000);

  start_time = millis();  // definisce start time come il tempo attuale 

  Serial.println(go_buzz_1);
  Serial.println(end_buzz_1);
  Serial.println(go_buzz_2);
  Serial.println(end_buzz_2);

}

void loop()
{
  lv_timer_handler(); /* let the GUI do its work */
  delay(5);
  Serial.println(rtc.formatDateTime(PCF_TIMEFORMAT_YYYY_MM_DD_H_M_S));  
  delay(1000);  
  lv_label_set_text(ui_Label14, rtc.formatDateTime(PCF_TIMEFORMAT_HM));
  
  /* POINTER TO LVGL ARC WIDGET */ 

  lv_obj_t *ui_Arc_pointer;  

  int32_t time_seconds = secondsFromHoursMinutes(rtc.formatDateTime(PCF_TIMEFORMAT_HM));
  Serial.println("prove:");
  Serial.println(rtc.formatDateTime(PCF_TIMEFORMAT_HM));
  Serial.println(atoi(rtc.formatDateTime(PCF_TIMEFORMAT_HM))); // TO CHECK TIME CONVERSION TO SEC
  Serial.println(atoi(rtc.formatDateTime(PCF_TIMEFORMAT_HM + 3))); // TO CHECK TIME CONVERSION TO SEC
  Serial.println(time_seconds);  // TO CHECK TIME CONVERSION TO SEC
  

  if (time_seconds >= 12*60*60) time_seconds = (time_seconds-12*60*60); // convert time to 12h
  if (time_seconds >= 0 && time_seconds < 15*60) ui_Arc_pointer=&ui_Arc2; // store ui_Arc2 address into pointer
  else if (time_seconds >= 15*60 && time_seconds < 30*60) ui_Arc_pointer=&ui_Arc1;  
  else if (time_seconds >= 30*60 && time_seconds < 45*60) ui_Arc_pointer=&ui_Arc3;
  else if (time_seconds >= 45*60 && time_seconds < 60*60) ui_Arc_pointer=&ui_Arc4;
  else if (time_seconds >= 60*60 && time_seconds < 75*60) ui_Arc_pointer=&ui_Arc5;
  else if (time_seconds >= 75*60 && time_seconds < 90*60) ui_Arc_pointer=&ui_Arc6;
  else if (time_seconds >= 90*60 && time_seconds < 105*60) ui_Arc_pointer=&ui_Arc7;
  else if (time_seconds >= 105*60 && time_seconds < 120*60) ui_Arc_pointer=&ui_Arc8;
  else if (time_seconds >= 120*60 && time_seconds < 135*60) ui_Arc_pointer=&ui_Arc9;
  else if (time_seconds >= 135*60 && time_seconds < 150*60) ui_Arc_pointer=&ui_Arc10;
  else if (time_seconds >= 150*60 && time_seconds < 165*60) ui_Arc_pointer=&ui_Arc11;
  else if (time_seconds >= 165*60 && time_seconds < 180*60) ui_Arc_pointer=&ui_Arc12;
  else if (time_seconds >= 180*60 && time_seconds < 195*60) ui_Arc_pointer=&ui_Arc13;
  else if (time_seconds >= 195*60 && time_seconds < 210*60) ui_Arc_pointer=&ui_Arc14;
  else if (time_seconds >= 210*60 && time_seconds < 225*60) ui_Arc_pointer=&ui_Arc15;
  else if (time_seconds >= 225*60 && time_seconds < 240*60) ui_Arc_pointer=&ui_Arc16;
  else if (time_seconds >= 240*60 && time_seconds < 255*60) ui_Arc_pointer=&ui_Arc17;
  else if (time_seconds >= 255*60 && time_seconds < 270*60) ui_Arc_pointer=&ui_Arc18;
  else if (time_seconds >= 270*60 && time_seconds < 285*60) ui_Arc_pointer=&ui_Arc19;
  else if (time_seconds >= 285*60 && time_seconds < 300*60) ui_Arc_pointer=&ui_Arc20;
  else if (time_seconds >= 300*60 && time_seconds < 315*60) ui_Arc_pointer=&ui_Arc21;
  else if (time_seconds >= 315*60 && time_seconds < 330*60) ui_Arc_pointer=&ui_Arc22;
  else if (time_seconds >= 330*60 && time_seconds < 345*60) ui_Arc_pointer=&ui_Arc23;
  else if (time_seconds >= 345*60 && time_seconds < 360*60) ui_Arc_pointer=&ui_Arc24;
  else if (time_seconds >= 360*60 && time_seconds < 375*60) ui_Arc_pointer=&ui_Arc25;
  else if (time_seconds >= 375*60 && time_seconds < 390*60) ui_Arc_pointer=&ui_Arc26;
  else if (time_seconds >= 390*60 && time_seconds < 405*60) ui_Arc_pointer=&ui_Arc27;
  else if (time_seconds >= 390*60 && time_seconds < 405*60) ui_Arc_pointer=&ui_Arc27;
  else if (time_seconds >= 405*60 && time_seconds < 420*60) ui_Arc_pointer=&ui_Arc28;
  else if (time_seconds >= 420*60 && time_seconds < 435*60) ui_Arc_pointer=&ui_Arc29;
  else if (time_seconds >= 435*60 && time_seconds < 450*60) ui_Arc_pointer=&ui_Arc30;
  else if (time_seconds >= 450*60 && time_seconds < 465*60) ui_Arc_pointer=&ui_Arc31;
  else if (time_seconds >= 465*60 && time_seconds < 480*60) ui_Arc_pointer=&ui_Arc32;
  else if (time_seconds >= 480*60 && time_seconds < 495*60) ui_Arc_pointer=&ui_Arc33;
  else if (time_seconds >= 495*60 && time_seconds < 510*60) ui_Arc_pointer=&ui_Arc34;
  else if (time_seconds >= 510*60 && time_seconds < 525*60) ui_Arc_pointer=&ui_Arc35;
  else if (time_seconds >= 525*60 && time_seconds < 540*60) ui_Arc_pointer=&ui_Arc36;
  else if (time_seconds >= 540*60 && time_seconds < 555*60) ui_Arc_pointer=&ui_Arc37;
  else if (time_seconds >= 555*60 && time_seconds < 570*60) ui_Arc_pointer=&ui_Arc38;
  else if (time_seconds >= 570*60 && time_seconds < 585*60) ui_Arc_pointer=&ui_Arc39;
  else if (time_seconds >= 585*60 && time_seconds < 600*60) ui_Arc_pointer=&ui_Arc40;
  else if (time_seconds >= 600*60 && time_seconds < 615*60) ui_Arc_pointer=&ui_Arc41;
  else if (time_seconds >= 615*60 && time_seconds < 630*60) ui_Arc_pointer=&ui_Arc42;
  else if (time_seconds >= 630*60 && time_seconds < 645*60) ui_Arc_pointer=&ui_Arc43;
  else if (time_seconds >= 645*60 && time_seconds < 660*60) ui_Arc_pointer=&ui_Arc44;
  else if (time_seconds >= 660*60 && time_seconds < 675*60) ui_Arc_pointer=&ui_Arc45;
  else if (time_seconds >= 675*60 && time_seconds < 690*60) ui_Arc_pointer=&ui_Arc46;
  else if (time_seconds >= 690*60 && time_seconds < 705*60) ui_Arc_pointer=&ui_Arc47;
  else if (time_seconds >= 705*60 && time_seconds < 720*60) ui_Arc_pointer=&ui_Arc48;


  timer = millis() - start_time;

  if (timer >= go_buzz_1 && timer < end_buzz_1) 
  { 
   digitalWrite(4, HIGH);
   Serial.println("buzz on 1"); 

  }
  else if (timer >= end_buzz_1 && timer < go_buzz_2) 
  { 
   digitalWrite(4, LOW);
   Serial.println("buzz off 1"); 

  }
  else if (timer >= go_buzz_2 && timer < end_buzz_2) 
  { 
   digitalWrite(4, HIGH);
   Serial.println("buzz on 2"); 

  }
  else if (timer >= end_buzz_2 && timer < end_buzz_2 + 90000) 
  { 
   digitalWrite(4, LOW);
   Serial.println("buzz off 2"); 
   if (digitalRead(35) == LOW)  // if button pressed once set the arc color to green (still need to add the case of button pressed twice)
   { 
    lv_obj_set_style_arc_color(*ui_Arc_pointer, lv_color_hex(0x40FF4B), LV_PART_MAIN);
   }
  }
  else if (timer >= 900000)  // after 15 minutes reset and restart 
  {
    start_time = millis();
    go_buzz_1 = random(1000, 801000);
    end_buzz_1 = go_buzz_1 + 2000;
    go_buzz_2 = go_buzz_1 + 4000;
    end_buzz_2 = go_buzz_1 + 6000;
    Serial.println(go_buzz_1);
    Serial.println(end_buzz_1);
    Serial.println(go_buzz_2);
    Serial.println(end_buzz_2);
  }

}

As I requested back in Post 12, please poste the complete error message.

Sorry, I missed that.
Here, I made a pdf of the code, so you can see line numbers. It's the only way I found. The pointer definition is at line 192.

code with line numbers.pdf (1,9 MB)

And here are the error messages. Hope this works.

C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino: In function 'void loop()':
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:203:66: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:204:75: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:205:75: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:206:75: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:207:75: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:208:75: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:209:76: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:210:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:211:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:212:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:213:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:214:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:215:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:216:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:217:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:218:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:219:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:220:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:221:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:222:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:223:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:224:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:225:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:226:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:227:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:228:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:229:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:230:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:231:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:232:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:233:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:234:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:235:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:236:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:237:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:238:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:239:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:240:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:241:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:242:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:243:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:244:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:245:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:246:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:247:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:248:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:249:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:250:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:251:77: error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment
C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:280:32: error: cannot convert 'lv_obj_t' {aka '_lv_obj_t'} to '_lv_obj_t*'
In file included from c:\users\angel\documents\arduino\libraries\lvgl\src/core/lv_obj_style.h:203,
                 from c:\users\angel\documents\arduino\libraries\lvgl\src/core/lv_obj.h:140,
                 from c:\users\angel\documents\arduino\libraries\lvgl\lvgl.h:35,
                 from c:\Users\angel\Documents\Arduino\libraries\lvgl\src/lvgl.h:17,
                 from C:\Users\angel\AppData\Local\Temp\.arduinoIDE-unsaved2023717-22332-485r8c.nohmx\sketch_aug17a\sketch_aug17a.ino:24:
c:\users\angel\documents\arduino\libraries\lvgl\src/core/lv_obj_style_gen.h:627:52: note:   initializing argument 1 of 'void lv_obj_set_style_arc_color(_lv_obj_t*, lv_color_t, lv_style_selector_t)'
 void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
                                 ~~~~~~~~~~~~~~~~~~~^~~

exit status 1

Compilation error: cannot convert 'lv_obj_t**' {aka '_lv_obj_t**'} to 'lv_obj_t*' {aka '_lv_obj_t*'} in assignment

@cedarlakeinstruments, here is the crash dump where I pasted the indicated lines from the various files called. I haven't been able to trace everything, nor fully understand it, yet...

Exception decode.pdf (78,1 KB)

Please note that the crash dump is referred to the very first version of the code I posted (post #1). The code is identical to the one in the pdf file in my post #19 except lines 192, 203-251 and 280.

Hope this helps.
I am still puzzled by the fact that apparently the code is working... :open_mouth:

The compiler errors flagged in your Post #19 are from all your assignment statements of the type:

else if (time_seconds >= 15*60 && time_seconds < 30*60) ui_Arc_pointer=&ui_Arc1; 

The problem is the extra '&'. The ui_Arc1 variable is apparently already a pointer (type 'lv_obj_t *'). So, adding '&' (the 'address of' operator) produces a pointer to a pointer (type 'lv_obj_t **'). You can't assign that to the variable 'ui_Arc_pointer' which of type 'lv_obj_t *'. So, get rid of the extra '&':

else if (time_seconds >= 15*60 && time_seconds < 30*60) ui_Arc_pointer=ui_Arc1; 

I think you had that correct construct in one of your previous versions, perhaps the one that caused run time exception shown in your Post #20. That exception ("EXCVADDR: 0x00009b81") is almost certainly from de-referencing an invalid pointer. @cedarlakeinstruments provided some tips for running that down. You should follow them.

BTW, every time I see your sequence of if / else statements, I want to point out something:

  if (time_seconds >= 0 && time_seconds < 15*60) ui_Arc_pointer=&ui_Arc2; // store ui_Arc2 address into pointer
  else if (time_seconds >= 15*60 && time_seconds < 30*60) ui_Arc_pointer=&ui_Arc1;  
  else if (time_seconds >= 30*60 && time_seconds < 45*60) ui_Arc_pointer=&ui_Arc3;
  else if (time_seconds >= 45*60 && time_seconds < 60*60) ui_Arc_pointer=&ui_Arc4;

Can you see that if the first 'if' statement fails, then you know that 'time_seconds >= 15*60' must be true? So, there's no need to test for it in the next 'if' statement. And so on. So, this is equivalent:

  if (time_seconds >= 0 && time_seconds < 15*60) ui_Arc_pointer=&ui_Arc2; // store ui_Arc2 address into pointer
  else if (time_seconds < 30*60) ui_Arc_pointer=&ui_Arc1;  
  else if (time_seconds < 45*60) ui_Arc_pointer=&ui_Arc3;
  else if (time_seconds < 60*60) ui_Arc_pointer=&ui_Arc4;

Also, can the 'time_seconds' variable ever be negative? If not, change it to an unsigned type. Then you can get rid of the test for '>= 0':

if (time_seconds < 15*60) ui_Arc_pointer=&ui_Arc2;