I'm working on a project with the Arduino Giga R1 Wifi and the Arduino Giga Display.
I'm building a UI for the project using LVGL 8.3.11, and am using the Arduino_H7_Video library for setting up the display.
My issue is that the physical display need to be oriented a specific way within the enclosure I have for it (in order to maintain access to the USB port), but that specific orientation results in my interface being upside down.
How can I go about rotating the display or interface 180 degrees? or flipping the display on X and Y. I've tried digging into the H7 video library to see what drivers are being used for the Display so In can try and make changes there. But I have come up with nothing. Would really appreciate some help!
My sketch is currently setup as per this tutorial for getting the display working with LVGL 8.3.11 and Squarline Studio.
I just found the answer, using same hardware I think the syntax is wrong, instead of lv_display_set... use lv_disp_set... . That is what everything else nearby used so I tried it and got rotation!
If there is a need to rotate the UI created in SquareLine on the GIGA Display Shield, there is a single line that needs to be added to one of the exported library files. In the
/ui/src
folder, find the
ui.c
file and open it.
The code we need to add is:
lv_display_set_rotation(dispp, rotation);
The rotation can be set to 0, 90, 180 or 270 depending on how much you want to rotate the UI.
If the lv_display_set_rotation(dispp, rotation); method works, is it possible to implement this dynamically at runtime instead of manually editing the ui.c file? This would make it more flexible for different use cases.