I’ve been trying to learn how to program the autonomous selection screen on my robot using LVGL in pros I’ve made a function that that is supposed to make a new button when it is called but when I try to build it it gives me an error and says
error: expression list treated as compound expression in initializer [-fpermissive]
error: cannot convert ‘const char*’ to ‘lv_obj_t*’ {aka ‘_lv_obj_t*’} in initialization
Here is my function
lv_obj_t * createBtn(std::string btn, lv_obj_t * parent, lv_coord_t x, lv_coord_t y, lv_coord_t width, lv_coord_t height, int id, std::string title)
{
lv_obj_t * btn = lv_btn_create(parent, NULL);
lv_obj_set_pos(btn, x, y);
lv_obj_set_size(btn, width, height);
lv_obj_set_free_num(btn, id);
lv_obj_t * label = lv_label_create(btn, NULL);
lv_label_set_text(label, title);
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 5);
return btn;
}
and here is how I call it
lv_obj_t * createBtn(“continueButton”, 140, 166, 200, 50, 0, “Continue”);