peterhinch / micropython-nano-gui

A lightweight MicroPython GUI library for display drivers based on framebuf class
MIT License
492 stars 87 forks source link

Simple procedure to rotate display #59

Closed MountainMan370 closed 10 months ago

MountainMan370 commented 10 months ago

I have the Nano-Gui demos working on a Raspberry Pi Pico with the Adafruit 3.5" TFT display using IlI9486 driver. However, the default text coordinate(0,0) seems to be in the lower right vs the upper left. I've addressed it for now by simply turning the display itself upside down and rotating it. However, I have used the same display with an Arduino Nano / Uno and Adafruit's HX8357 driver. That driver has a simple Rotate display option as one of the first setup command lines. Is anything like this possible with ili9486 driver (or did I miss something in the library itself)? Note only other issue that I had was to to comment out the check for the firmware. I'm using Pimoroni's UF2 Micropython version since I use many of their other products for the Pico and its use triggered an exception until I removed the firmware check. Thank you for providing this program to the community !

beetlegigg commented 10 months ago

I was updating my display using nano-gui just now, and your email popped in to my inbox as I watch Peters repository to keep up to date with it as I use it a lot. I checked my color_setup.py as I'm sure I had to rotate the display when I used the ili9486 driver and there I see usd=True From the doc's: usd=False Upside down: set True to invert display. However it does not rotate from landscape to portrait mode, but I think usd is probably what you are after.

MountainMan370 commented 10 months ago

I changed line #69 in the IlI9486.py file so that usd=True. That solved it!
Thanks for helping me with this and especially so quickly!!

MountainMan370 commented 10 months ago

Definitely ! Thanks again for making this application available.

On Tue, Nov 28, 2023 at 4:45 AM Peter Hinch @.***> wrote:

Closed #59 https://github.com/peterhinch/micropython-nano-gui/issues/59 as completed.

— Reply to this email directly, view it on GitHub https://github.com/peterhinch/micropython-nano-gui/issues/59#event-11081153940, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATVWPHBG37E7ICQPUV7EDWDYGWXC5AVCNFSM6AAAAAA73FNKISVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGA4DCMJVGM4TIMA . You are receiving this because you authored the thread.Message ID: @.*** com>