peterhinch / micropython-touch

A GUI for touch panel displays.
MIT License
17 stars 2 forks source link

Small example errors #3

Closed beetlegigg closed 3 months ago

beetlegigg commented 3 months ago

the example hardware_setup for the XPT2046 has tpad = XPT2046(spi, cspin=Pin(0), ssd) which gives the error 'positional arg after keyword arg' Of course tpad = XPT2046(spi, Pin(0), ssd) works OK.

Also, for the ssd parameters I have usd=False and the screen demo's work ok.
However the touch demo - simple.py - whilst it displays the yes and no labels and the quit label in the expected place, the touch coordinates are still operating in the usd=True place. (i.e as if the sreen is upside down) I expect one of the 'True' parameters in the tpad.init(240, 320, 270, 330, 3890, 3980, True, True, True) should be set to False but not sure, so I thought I would ask the man who knows :-)

Its looking quite good for one of my ili9341 screens and I think I should be able work with it.

peterhinch commented 3 months ago

Thanks for the report - I had already found that first bug.

Re setup.py the version I released was needlessly complex and may well be buggy. I've just posted an update, perhaps you could try it and see if the boolean values are now correct.

If you are still having problems please report and I will do some more testing. it's quite tricky to test all the possible combinations.

It is possible to figure the booleans out manually if you run touch.check as described here. The meaning of the bools is described here. If you're in landscape mode it sounds like you need to toggle the middle one (reflect rows).

As is probably obvious I'm actively working on the setup side of things (I'm reasonably confident of the GUI itself) so please watch this space.

beetlegigg commented 3 months ago

Thanks, the new setup.py and touch.py has got it sorted. I'm very impressed after trying the various.py demo where even my fat finger can action those little circle buttons. I will keep monitoring the site for updates as you suggest.

Just FYI, on an rpi picW I also tried out the touch utilising the hard SPI with the other SPI bus (1). This seems to work ok, though noting the comment of "2.5MHz max" I remark that I did not specify a baud rate for this SPI bus and I'm not sure what the default baud rate of the SPI is. However its working OK at the moment :-)

peterhinch commented 3 months ago

The default is 1MHz. Data rates on the touch interface is not critical: specifying 2.5MHz won't make the slightest difference to performance. I quote datasheet values simply for reference.

I'm glad it's working for you, thank you for the report. I'll close this, but please report anything else that crops up.