Inkplate 6Flick - Unable to change and display screens with LVGL

I am trying to setup my 6Flick to act as an e-reader with LVGL. To begin with, I have been trying to set up multiple screens that I can switch between and update with information. I have 2 screens set up for a test; A “Menu” screen with a button for more information and a “Details” screen with information about the chosen entry. I have callbacks from the clicked event for my buttons on each screen. In the callback function, I try to load the new screen but I seem to be failing.

Things I have tried:

  • Played around with partial vs complete refresh of the screen
  • Tried to call to lv_timer_handler and inkplate.display within the callback functions after loading the new screen
  • Invalidated the active screen
  • Tried both lvgl object (Normal rectangle) and button type object

It seems that the event triggers fine, since my serial log tells me that it does, but if I load a screen on that event, then the button is non-responsive. If I clear the display, I just see a white screen and not the one I should have. I have uploaded the arduino sketch here as well.

I am not sure of the extent of LVGL support that this screen has and I do not have a lot of experience with LVGL unfortunately to troubleshoot this.

LVGL_Demo_App.ino (2.3 KB)

Hello nithin2302,
I am attaching below an updated sketch which solves the responsiveness you were mentioning. LVGL is quite a heavy library to run on a microcontroller, especially on e-paper which takes a lot longer to update compared to an LCD screen. This issue is best dealt with by creating multiple threads which run multiple tasks in unison. The library has mutex locking and unlocking built-in so you can more easily control the access to shared thread resources as seen in the sketch below.

If you are not comfortable with learning the LVGL ins and outs for your project, i would recommend you check out Inkplate Library using Adafruit GFX, it is a much simpler GUI which also provides image decoding and downloading from the web, along with a variety of built in examples and projects showing the features of it.

LVGL_Demo_App.zip (2.2 KB)

Hello!

I tried this and it works wonderfully! I did not think that threading would be required at this stage, but thank you for the great example! Hopefully, I can come back when I have built an LVGL based e-reader with the 6Flick!