peterhinch / micropython-micro-gui

A lightweight MicroPython GUI library for display drivers based on framebuf, allows input via pushbuttons. See also micropython-touch.
MIT License
270 stars 40 forks source link

Something is missing? #47

Open mhgue opened 6 months ago

mhgue commented 6 months ago

I tried to use the micro-gui on a WaveShare Pico-LCD-1.3 with ST7789VW. In the setup_examples there is a nearby module just a little smaller (1.14"). So I took st7789_pico_lcd_114_rgb565.py as hardware_setup.py but failed. There is no pico.py in drivers/st7789 and there is no class LCD_1inch14. So I tried st7789_pico_lcd_114.py which is using drivers.st7789.st7789_4bit. Just adapted the size (in line 27). But running the aclock.py demo, I get a tiny little clock with upper half at the lower edge and vice versa. Some areas do look like random data and the rest keeps black. Looking in st7789_4bit.py there is a display type WAVESHARE_13 = (0, 0, 16) that is commented as being for the Waveshare 1.3" 240x240 LCD. So I changed the display type in my hardware_setup.py derived from st7789_pico_lcd_114.py to display=WAVESHARE_13. But now with this I do get the message WARNING: unsupported display parameter value. because in st7789_4bit.py only GENERIC, TDISPLAY, PI_PICO_LCD_2 are accepted.

Would it be possible to provide a working setup_examples/st7789_pico_lcd_13_rgb565.py, or give me some hints about missing external parts? Thank you.

PS: class LCD_1inch14 seems to be from waveshare/Pico_code/Python/Pico-LCD-1.14/Pico-LCD-1.14.py.

peterhinch commented 6 months ago

Different display boards connect the ST7789 to the display hardware in varying ways. The display tuple is intended to enable differing configurations to be accommodated. Unfortunately it's impossible to determine the correct configuration for a display without buying one and there is a limit to the number of these tings I can buy.

Feel free to experiment by creating a new tuple here - you'll see that there are already some user contributions and I'll be happy to accept one from you (and credit you) if you manage to create one that works.

Ignore the warning. Now that there are so many variants I don't think it serves much purpose; I'll remove it from the driver.

If you experiment with tuple values, the aim is to run this script and achieve a pixel-perfect result. This should guarantee that the GUI will run correctly.