Skip to content
Discussion options

You must be logged in to vote

You can include a function to update a label or gauge object like this:

static void custom_label_update(uint8_t page, uint8_t id, String text)
{
    lv_obj_t* label = hasp_find_obj_from_page_id(page, id);
    if(!label) return; // object doesn't exist
    lv_label_set_text(label, text.c_str());  // Use c string function the get the text data only
}

static void custom_gauge_update(uint8_t page, uint8_t id, int32_t val)
{
    lv_obj_t* gauge = hasp_find_obj_from_page_id(page, id);
    if(!gauge) return; // object doesn't exist
    lv_gauge_set_value(gauge, 0, val);  // 0 is the needle id (always use 0)
}

static void custom_read_battery() {
    if(millis() - last_blink >= blink_speed) {   //

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@richardsg307
Comment options

@fvanroie
Comment options

@richardsg307
Comment options

@fvanroie
Comment options

@richardsg307
Comment options

Answer selected by richardsg307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants