Rotate unPhone screen?

I was wondering if there was a straightforward way to be able to rotate the unPhone’s screen? I’d tried using setRotation from the adafruit gfx library, and while this would rotate the display it would also mirror it in weird ways (ie drawn text would be backwards) which I couldn’t figure out how to resolve.

P.S I’m using the unPhone 9 and building off of the ‘everything’ example, so had been trying to do this rotation in unPhoneUI0.cpp

I’ve had exactly the same issue.
If you look at the library (Adafruit_HX8357.cpp) there are defined values for MADCTL_MY, MADCTL_MX and MADCTL_MV. The values are set at 0x80, 0x40 and 0x20 respectively. I found that changing it to 0x80,0x00 and 0x20 sorted things out for a landscape rotation ( tftlsetRotation(3)). These values set the most significant bits, so turning them on and off in a particular order sorts the font mirroring out.

1 Like