Closed CedarGroveStudios closed 2 years ago
There is also an STMPE610 breakout that can be used as desired…
Jerry Needell @.*** +1 603 969 6723
On Jan 19, 2022, at 13:35, Cedar Grove Maker Studios @.***> wrote:
I have a slightly revised version of adafruit_stmpe610 that is working nicely with adafruit_button. I added a touch_point parameter and instantiation kwargs for display size and touch calibration (duplicating how adafruit_touchscreen works) as well as a new argument for display rotation. Defining the rotation at instantiation greatly simplifies usage particularly with on-screen buttons, something I'm planning to suggest for adafruit_touchscreen as well.
The current round of tests are being conducted using the 2.4" (#3315) and 3.5" (#3651) TFT wings with a Feather M4 Express running v7.1.1. The touchscreen's x-axis is reversed on the 3.5" TFT, so I'm planning to add another kwarg to flip the minimum/maximum touch axis values to accommodate the wiring difference.
Before proceeding with a PR, I need to know if the 2.4" and 3.5" TFT wings are the only Adafruit products using the STMPE610 controller. I wasn't able to find any others, but wanted to be certain before adding the touch axis flip kwarg.
@jerryneedell and @FoamyGuy : can you help?
Thanks!
new instantiation example without the proposed axis flip kwarg:
ts = adafruit_stmpe610.Adafruit_STMPE610_SPI( spi, ts_cs_pin, calibration=((357, 3812), (390, 3555)), size=(display.width, display.height), display_rotation=display.rotation, ) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
Ah yes, thanks. The discontinued #1571. I don't have one for testing but will anticipate that either or both axis ranges might need to be swapped since breakout wiring isn't fixed. Thinking about adding a kwarg like:
(... touch_flip=None ...) # for no axis range change
(... touch_flip=(True, False) ...) # to flip the touch x-axis range
(... touch_flip=(False, True) ...) # to flip the touch y-axis range
(... touch_flip=(True, True) ...) # to flip both touch axis ranges
Ah -- I did not realize it had been discontinued -- then I would not worry about it. I do have one and will try to test the PR on it when its in if I can find it.... That axis flip kwarg sounds ok to me. It's been a long time since I looked at the driver. It was one of the very first things I ever did in python so I hope it was not to painful to modify....
I'd guess that there are a few of the old breakouts out there, but it's not likely that they'll need the new features unless they are repurposed. I'll add the more flexible version of the axis flip kwarg just in case. Walking through the driver code was a great experience. I know the approach to register management has changed a bit, but your code was easy to follow. Nicely done. I enjoy looking through other folks' code as part of my education 'cause I still feel like every python project I work on is my first.
Will submit a PR with the Displayio Button compatible touch_point
property.
I have a slightly revised version of
adafruit_stmpe610
that is working nicely withadafruit_button
. Without changing the existing parameters and kwargs, I added atouch_point
parameter and instantiation kwargs for display size and touch calibration (duplicating howadafruit_touchscreen
works) as well as a new argument for display rotation. Defining the rotation at instantiation greatly simplifies usage particularly with on-screen buttons, something I'm planning to suggest foradafruit_touchscreen
as well.The current round of tests are being conducted using the 2.4" (#3315) and 3.5" (#3651) TFT wings with a Feather M4 Express running v7.1.1. The touchscreen's x-axis is reversed on the 3.5" TFT, so I'm planning to add another kwarg to flip the minimum/maximum touch axis values to accommodate the wiring difference.
Before proceeding with a PR, I need to know if the 2.4" and 3.5" TFT wings are the only Adafruit products using the STMPE610 controller. I wasn't able to find any others, but wanted to be certain before adding the touch axis flip kwarg.
@jerryneedell and @FoamyGuy : can you help?
Thanks!
new instantiation example without the proposed axis flip kwarg: