WARNING: library MKRIMU claims to run on samd architecture(s) and may be incompatible with your current board which runs on mbed_giga architecture(s).
/Users/andreanocentini/Desktop/arduino mega/programma_vecchio_lvgl/programma_vecchio_lvgl.ino: In function 'void setup()':
/Users/andreanocentini/Desktop/arduino mega/programma_vecchio_lvgl/programma_vecchio_lvgl.ino:152:1: error: 'lv_obj_set_style_local_text_font' was not declared in this scope
lv_obj_set_style_local_text_font(label_SOG, LV_PART_MAIN, LV_STATE_DEFAULT, &lv_font_montserrat_28);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/andreanocentini/Desktop/arduino mega/programma_vecchio_lvgl/programma_vecchio_lvgl.ino:152:1: note: suggested alternative: 'lv_obj_set_style_text_font'
lv_obj_set_style_local_text_font(label_SOG, LV_PART_MAIN, LV_STATE_DEFAULT, &lv_font_montserrat_28);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lv_obj_set_style_text_font
/Users/andreanocentini/Desktop/arduino mega/programma_vecchio_lvgl/programma_vecchio_lvgl.ino:191:50: warning: format '%d' expects argument of type 'int', but argument 3 has type 'double' [-Wformat=]
lv_label_set_text_fmt(label_AWA, "AWA: %d", AWA);
^
/Users/andreanocentini/Desktop/arduino mega/programma_vecchio_lvgl/programma_vecchio_lvgl.ino:198:58: warning: format '%d' expects argument of type 'int', but argument 3 has type 'double' [-Wformat=]
lv_label_set_text_fmt(label_LAT, "LAT: %d", latitudine1);
^
exit status 1
Compilation error: 'lv_obj_set_style_local_text_font' was not declared in this scope
the code I use is:
lv_obj_t *label_station;
lv_obj_t *label_time;
lv_obj_t *label_battery;
lv_obj_t *label_TWA;
lv_obj_t *label_SOG;
lv_obj_t *label_Heading;
lv_obj_t *label_TWS;
lv_obj_t *label_GPSheading;
lv_obj_t *label_Pitch;
lv_obj_t *label_AWA;
lv_obj_t *label_LAT;
lv_obj_t *label_ROLL;
void setup() {
Serial.begin(115200);
while (!Serial)
; //Wait for user to open terminal
Display.begin();
TouchDetector.begin();
lv_obj_t* screen = lv_obj_create(lv_scr_act());
lv_obj_set_size(screen, Display.width(), Display.height());
static lv_coord_t col_dsc[] = { 263, 263, 263, LV_GRID_TEMPLATE_LAST };
static lv_coord_t row_dsc[] = { 25, 150, 150, 150, 150, LV_GRID_TEMPLATE_LAST };
lv_obj_t* grid = lv_obj_create(lv_scr_act());
lv_obj_set_grid_dsc_array(grid, col_dsc, row_dsc);
lv_obj_set_size(grid, Display.width(), Display.height());
///////////////////////////////////////////////////////////////////////////////////
lv_obj_t* obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 0, 1, //column
LV_GRID_ALIGN_STRETCH, 0, 1); //row
label_station = lv_label_create(obj);
lv_obj_align(label_station, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_station, "Stazione %s", Station ? "connessa" : "disconnessa");
///////////////////////////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 1, 1, //column
LV_GRID_ALIGN_STRETCH, 0, 1); //row
label_time = lv_label_create(obj);
lv_obj_align(label_time, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_time, "%d:%d:%d", ore, minuti, secondi );
///////////////////////////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 2, 1, //column
LV_GRID_ALIGN_STRETCH, 0, 1); //row
label_battery = lv_label_create(obj);
lv_obj_align(label_battery, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_battery, "bateria staz.: %d", battery);
///////////////////////////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 0, 1, //column
LV_GRID_ALIGN_STRETCH, 1, 1); //row
label_TWA = lv_label_create(obj);
lv_obj_align(label_TWA, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_TWA, "TWA: %d", TWA);
///////////////////////////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 1, 1, //column
LV_GRID_ALIGN_STRETCH, 1, 1); //row
label_SOG= lv_label_create(obj);
lv_obj_set_style_local_text_font(label_SOG, LV_PART_MAIN, LV_STATE_DEFAULT, &lv_font_montserrat_28); //problem!!!!!!
lv_obj_align(label_SOG, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_SOG, "SOG: %.2f", velocita);
///////////////////////////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 2, 1, //column
LV_GRID_ALIGN_STRETCH, 1, 1); //row
label_Heading = lv_label_create(obj);
lv_obj_align(label_Heading, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_Heading, "MHEAD: %.2f", heading);
////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 0, 1, //column
LV_GRID_ALIGN_STRETCH, 2, 1); //row
label_TWS = lv_label_create(obj);
lv_obj_align(label_TWS, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_TWS, "TWS: %d", TWS);
////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 1, 1, //column
LV_GRID_ALIGN_STRETCH, 2, 1); //row
label_GPSheading= lv_label_create(obj);
lv_obj_align(label_GPSheading, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_GPSheading, "GHEAD: %d", rottaGps1);
////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 2, 1, //column
LV_GRID_ALIGN_STRETCH, 2, 1); //row
label_Pitch = lv_label_create(obj);
lv_obj_align(label_Pitch, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_Pitch, "Pitch: %d", pitch1);
////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 0, 1, //column
LV_GRID_ALIGN_STRETCH, 3, 1); //row
label_AWA = lv_label_create(obj);
lv_obj_align(label_AWA, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_AWA, "AWA: %d", AWA);
////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 1, 1, //column
LV_GRID_ALIGN_STRETCH, 3, 1); //row
label_LAT = lv_label_create(obj);
lv_obj_align(label_LAT, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_LAT, "LAT: %d", latitudine1);
////////////////////////////////////////////////////////////
obj = lv_obj_create(grid);
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, 2, 1, //column
LV_GRID_ALIGN_STRETCH, 3, 1); //row
label_ROLL = lv_label_create(obj);
lv_obj_align(label_ROLL, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(label_ROLL, "Pitch: %d", roll1);
This library is beautiful, you do beautiful and very useful things.
but let's say that basic things like writing text and changing a font are not well documented. I'm going crazy about it!