Rotate Arduino Giga Display 180

Hello! I’m working on a project with the Arduino Giga Display.
I’ve built an interface using Squareline 1.4.2 Studio and LVGL 8.3.11

I’m using the Arduino_H7_Video library and have setup the display like so

Arduino_H7_Video          Display(800, 480, GigaDisplayShield);
Arduino_GigaDisplayTouch  TouchDetector;

And then in my setup code I just have Display.begin();

How can I go about rotating the display 180 degrees? I’ve read that I just need to flip the X and Y coordinates of my display driver, but I have no clue how to do that.

I’m on Arduino Mbed OS Giga 4.1.5

Thanks!

Checking the constructor function (you use above) in Arduino_H7_Video.cpp file reveals that the internal _rotation boolean variable (which in turn sets rotation by lv_display_set_rotation in the ‘begin’ function) is really set depending on the EDID-mode correlated with resolution. With most EDID-modes (640x480,800x600,1024x78,etc.) it really sets rotation to ‘true’ if the width and height gives the opposite aspect-ratio what EDID resolution dictates. There’s EDID-mode 480x800 as a distinct case, and if you have that mode, your function above should set the _rotation to ‘true’. But if you have 800x480 EDID-mode, the width and height should be exchanged to set the opposite, 480 and 800. (If that still doesn’t help, maybe you should play around with the EDID-mode. There’s set_display_mode function in edid.h for example…)

Thank you for the response!

With the info you shared I was able to rotate the display 90 degrees (from Landscape to Portrait) by changing the resolution from 800x480 to 480x800. So that works for portrait.

Digging into the edid.h now and the edid modes to figure out if I can rotate it the full 180 degrees to get landscape inverted/flipped. I’ll keep playing with it. But if you have any ides, please do let me know.

Appreciate it

Ok, with the info you shared I ended up finding a solution.

I ended up just setting the rotation at runtime with LVGL’s lv_set_disp_rotation();

1 Like