TftTouchGetCoordinates()

Library Description ›› Touch ››
Parent Previous Next

TftTouchGetCoordinates(pMode As Bit), Bit


pMode - Low Pass Filter Setting

• 1 = Use Low Pass Filter

• 0 = Do not use Low Pass Filter

Return Bit - Valid Coordinates

• 1 = Valid

• 0 = Not Valid


This procedure returns the Touch-to-Screen equivalent coordinates, which are placed into two global variables: wTouchToPointX and wTouchToPointY.


Low Pass Filter vs. No Filter:

• Low Pass Filter: Using the low pass filter results in slower but more accurate touch readings. It smooths out the ADC noise, making the results more reliable.

• No Low Pass Filter: Skipping the low pass filter provides faster touch readouts, but with potentially reduced accuracy.


Low Pass Filter Mechanics:

• When a touch event is detected that exceeds the minimum pressure threshold in the Z direction (Z_Threshold), a number of samples (TouchAveragePoints) are taken.

• Out of these samples, any values that deviate beyond the TouchMedianDistance in the X or Y direction are discarded.

• The remaining valid values are then averaged to provide the final coordinates.


The Return Bit indicates whether the coordinates fall within the valid screen boundaries or are at least 10 points away from the ADC’s minimum or maximum values. This is particularly useful for detecting borderline readouts where the converted results might be inaccurate due to ADC glitches or extreme values.


Example:

TftTouchGetCoordinates(1)






Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's Advanced Project Analyzer