-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
I have https://www.adafruit.com/product/2478, and the only way I can get it to work is with the following diff:
diff --git a/adafruit_touchscreen.py b/adafruit_touchscreen.py
index 5bf0fe0..4f28761 100644
--- a/adafruit_touchscreen.py
+++ b/adafruit_touchscreen.py
@@ -136,7 +136,7 @@ class Touchscreen:
with AnalogIn(self._yp_pin) as y_p:
z_2 = y_p.value
# print(z_1, z_2)
- z = 65535 - (z_2 - z_1)
+ z = z_2 + z_1
if z > self._zthresh:
with DigitalInOut(self._yp_pin) as y_p:
and a threshold value of around 40000.
Without this diff, the bottom right of the screen never registers a press.
I don't know much about these kinds of screens. Presumably this code works for other screens. Do some screens reverse this? I triple checked my wires and I don't think I wired anything backwards.
I also had to reverse the X calibration to make the coordinates correspond to the ones used when drawing on the screen:
calibration=([59889, 12545], [16373, 61473]),
Metadata
Metadata
Assignees
Labels
No labels