Go Down

Topic: Can I change the orientation of LCD to landscape without a headache? (Read 913 times) previous topic - next topic

edwinforthewin

Hey there

I found the perfect display for my project (https://www.adafruit.com/products/358#Technical Details) but I need it to be landscape and not vertical as it is designed. Is this possible without a headache of code and whatnot? Or do I need to find another LCD?

Thanks

Magicj

I am not familiar with this screen or the library utilised, but all the LCD screens that I have used can be used in either landscape or portrait modes.

To quote from http://learn.adafruit.com/adafruit-gfx-graphics-library/coordinate-system-and-units

Quote
To use a tall "portrait" layout rather than wide "landscape" format, or if physical constraints dictate the orientation of a display in an enclosure, one of four rotation settings can also be applied, indicating which corner of the display represents the top left.


Based on this you should be OK but it's probably best to have a read of the library documentation.

Cheers

kowalski

Hi @edwinforthewin.

That LCD is a ST7735R device which actually has hardware support for handling the addressing (landscape, portrait, mirror, etc). The problem is finding good library support for that and then the real problem is writing the application to scale to the direction (if you want to be able to flip as an "iPad").

Here is a link to the direction change member function in Cosa/ST7735 driver.
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/SPI/Driver/ST7735.cpp#L182

Here is also a link to a demo sketch that flips direction (see line 291);
https://github.com/mikaelpatel/Cosa/blob/master/examples/Canvas/CosaCanvasST7735/CosaCanvasST7735.ino

Cheers!

Go Up