Configuring Touch Pressure - ImpulseAdventure/GUIslice GitHub Wiki
Configuring ADATOUCH_PRESS Values
Most of the resistive touch controllers return a "pressure" reading (sometimes labelled "Z"). This pressure reading is used to determine whether a valid touch was made on the display. In many case, a display may return a noisy low touch value even though nothing was touching the resistive overlay. Therefore, we need to specify a minimum value that reflects a real touch event.
Configuration values relating to touch pressure values:
ADATOUCH_PRESS_MIN
ADATOUCH_PRESS_MAX
A future diagnostic sketch will be provided to estimate good values for the above. The default values in the config files will work for most people. However, one can adjust the values based on the result of the diag_ard_touch_calib
sketch as follows:
- MIN should be less than the smallest Z value reported during calibration
- MAX should be more than the largest Z value reported during calibration
Background on Touch Pressure
Even though the touch controllers return a "pressure" reading, and it sometimes reflects how hard one presses on the touch overlay, it is not actually measuring pressure. Instead, some math is done to determine how large a contact region was made on the touch overlay. A very light touch (with a fingertip) will have a small contact patch, returning a low pressure value. A firm touch with a fingertip or thumb will have a larger contact patch, returning a high pressure value. But note that a stylus will always have a small contact patch, irrespective of how hard one presses (obviously one must be careful not to crack the overlay). Furthermore, the pressure readings from the display will vary widely based on the location on the display. Therefore, this reading is generally not at all useful for determine whether a light touch or firm touch was made on the display. Instead, it should just be used to filter out noisy non-touch values from real touch values.