Description
Hi guys,
I am trying to transplant LVGL to STM32H750Disco. I have made my LCD and touch pad working. It can display the button with the button example code listed below. But the button widget doesn’t respond to my click, it doesn’t change at all. I can only see the output “Clicked” and “Toggled” from the serial port, which shows my touch pad driver works fine. Is there anything I did wrong? Thanks.
What MCU/Processor/Board and compiler are you using?
STM32H750Disco
What LVGL version are you using?
V7.10
What do you want to achieve?
What have you tried so far?
Code to reproduce
static void event_handler(lv_obj_t * obj, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
printf("Clicked\n");
}
else if(event == LV_EVENT_VALUE_CHANGED) {
printf("Toggled\n");
}
}
void lv_ex_btn_1(void)
{
lv_obj_t * label;
lv_obj_t * btn1 = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(btn1, event_handler);
lv_obj_align(btn1, NULL, LV_ALIGN_CENTER, 0, -40);
label = lv_label_create(btn1, NULL);
lv_label_set_text(label, "Button");
lv_obj_t * btn2 = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(btn2, event_handler);
lv_obj_align(btn2, NULL, LV_ALIGN_CENTER, 0, 40);
lv_btn_set_checkable(btn2, true);
lv_btn_toggle(btn2);
lv_btn_set_fit2(btn2, LV_FIT_NONE, LV_FIT_TIGHT);
label = lv_label_create(btn2, NULL);
lv_label_set_text(label, "Toggled");
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.