peterhinch / micropython-touch

A GUI for touch panel displays.
MIT License
25 stars 5 forks source link

Stopping Free Ram messages. #5

Closed beetlegigg closed 7 months ago

beetlegigg commented 7 months ago

Hi Peter, I wanted to turn off the 'Free Ram' message as a default so I changed the global variable in tgui.py to _vb = False. As I'm developing my touch screen with mqtt_as I have to freeze the touch and the mqtt or I run into memory issues even with just a picoW running the ili9341 screen, thus I wanted to freeze in the default ram reporting message to not report the ram.

But I then tried to see if I could turn it on temporarily in my hardware_setup.py by doing the following: from gui.core.tgui import Display, _vb _vb = True Well that does not work :-). Is there a way to get this reporting to be set via some sort of verbose=True setting somewhere? ( I see you recently removed the verbose setting in XPT2046.py so perhaps you intend to remove this Free Ram reporting as your development proceeds in any case)

PS - the touch is working very well and I've used your font to py utility, (probably assisting in my lack of ram as I used it quite enthusiastically :) ), and the resulting large display numbers with large up and down buttons to change the displayed number is looking very nice - I do like the button litcolor which shows the button presses really well. My next task is to see if I can get some large up and down arrows to be displayed on the buttons.

peterhinch commented 7 months ago

The way to do this is in setup.py:

from gui.core.tgui import Display, quiet
quiet()

If you have not frozen hardware_setup.py this can be done without needing to rebuild. I will update the setup examples to illustrate this.

Re the changes to touch.py I concluded that my variance calculation was achieving nothing useful. Formerly if a sample set showed too much variation it was discarded and a message emitted. Now that is not done, so there is nothing to report - hence no variance or verbose args. More importantly there was a bug which particularly affected calibration. Now the process is more deterministic and more accurate.

I have also updated the demos: they were originally written for micro-gui which can be run on quite small screens. Touch displays seem to start at about 240 pixels, so I've scaled them up. There are a couple of bugfixes: the free RAM messages were wildly out, and the Dropdown widget was hard to use.

Re icon buttons have you seen this doc?

beetlegigg commented 7 months ago

Thanks for the pointers, I will freeze the latest updated versions and use the quite() when I've done with the development. The reminder to re-read your doc re the bitmap editor is apt as I had skirted over this bit of the docs and it does look to be a good solution to what I'm after.