adafruit / Adafruit_CircuitPython_RGB_Display

Drivers for RGB displays for Adafruit CircuitPython.
MIT License
131 stars 52 forks source link

Added rotation property and added HX8357 support #38

Closed makermelissa closed 4 years ago

makermelissa commented 4 years ago

As I was adding displays to the Pillow examples, I've noticed that for some displays 90 degrees is landscape and some it is portrait. This is not too difficult to deal except I figured it would be even easier if we could place it in the initialization like it is in displayio now.

I added a kw arg rotation property that can be passed in the initialization so the user will only need to uncomment one line. Also, the way I added it, it is completely backwards compatible.

I added HX8357 support to the Pillow examples and updated the examples to take advantage of the rotation property in the initializer. It then reads the property to determine if the with and height variables need to be swapped.

Tested on the HX8357 and ILI9341 displays.