Closed atroph closed 1 year ago
Not sure if this is what you are looking for. The screen pressure for the touchController.touched() is in the library XPT2046_Touchscreen.cpp line 25
Not sure if this is what you are looking for. The screen pressure for the touchController.touched() is in the library XPT2046_Touchscreen.cpp line 25 #define Z_THRESHOLD 400
That seems to have done it.
Changed the value to 800 for testing and the phantom touches have went away.
Captured about 30 mins of data without a single event.
Thanks!
Thank you @TiVoHomeUser!
Looks like people are shifting this Z-value in both directions - depending on their displays I guess.
------------------------ BUG REPORT -----------------------------------------
Expected behavior
The program will disregard any false touches and only register a touch when it meets a certain time threshold.
ex: The touch screen shall be touched continuously for 100ms in order for the touch to be registered as valid.
I have noticed that the IRQ line is exceptionally noisy and am wondering if there is some hardware filtering that is either missing, not working correctly, or this is normal behavior. This can be observed on the official kit by looking at the built-in LED on the uc module and noticing that it is continuously flashing at a very fast and dim rate. When the screen is touched the LED becomes brighter and is periodic in appearance until the touch is released.
Actual behavior
Actual touches register at a random value and only repeat at the interval set below at line 276.
Line 277 was added by me to trigger logic captures.
It appears that a touch is registered when the IRQ line goes low for an amount of time that I can't seem to find in the code. If "noise" meets that threshold it'll show up as a false touch. Maybe a debounce timer needs to be tweaked? I'm more of a hardware person vs a software one.
500ms Touch screen constantly pressed. IRQ line is periodic and touch is registered every 500ms.
1000ms Touch screen constantly pressed. IRQ line is periodic and touch is registered every 1000ms.
False touch (notice the IRQ line at the top does not show a periodic waveform) Touch screen not touched, IRQ line has a low point with a maximum period of 17us, touch is registered.
Weather Station Color version
Using the master branch, latest version (Feb commits?). Tested with no changes made to the code with the exception of wifi settings and api key. Tested with city code, time zone changed, wifi settings and api key. Tested with "if (touchController.isTouched(500))" Tested with "if (touchController.isTouched(1000))"
Hardware
Hardware is official kit and observed on two different kits brand new out of the box.
------------------------ END BUG REPORT -------------------------------------