Global Input-Output Variables, Created and Used by Touch.inc for Use in the User Program:
wTouchToPointX and wTouchToPointY hold the converted touch coordinates, representing the corresponding actual screen pixel positions (X and Y).
These values are determined based on calibration coefficients.
You can read the touch coordinates from wTouchToPointX and wTouchToPointY after calling the TftTouchGetCoordinates() function.
Touch screen point calculation uses the faster Q16.16 fixed point math instead of the floating point math since version 2.03.
Thus not compatible with previous version if calibration values were saved as floating point, if no stored values are pre-loaded, then use as before.
These are the calibration coefficients used to convert touch coordinates to the corresponding actual screen pixel positions.
These coefficients are obtained through the TftTouchCalibration() procedure and can either be used immediately or saved for future use.
If you intend to use these calibration coefficients (sdwKX1_FP, sdwKX2_FP, sdwKX3_FP, sdwKY1_FP, sdwKY2_FP, sdwKY3_FP) in the future,
it’s important to save them to memory (either internal or external).
After a reset, you will need to reload these values if the touch functionality is going to be used again.
Use variables directly to preload them from an external source, they are already declared in Touch.inc file.
If you want to convert the older floating point coefficients to fixed point coefficients, load the values into fKX1, fKX2, fKX3, fKY1, fKY2, fKY3 (As Float)
call the helper procedure TftTouchCalcCoefFixed() and save back sdwKX1_FP, sdwKX2_FP, sdwKX3_FP, sdwKY1_FP, sdwKY2_FP, sdwKY3_FP (As SDword) - this is a
work-around if you don't want to force touch re-calibration after firmware update.
!!!! Older depreciated version using floating point math before version 2.03 !!!!
These are the calibration coefficients used to convert touch coordinates to the corresponding actual screen pixel positions.
These coefficients are obtained through the TftTouchCalibration() procedure and can either be used immediately or saved for future use.
If you intend to use these calibration coefficients (fKX1, fKX2, fKX3, fKY1, fKY2, fKY3) in the future,
it’s important to save them to memory (either internal or external).
After a reset, you will need to reload these values if the touch functionality is going to be used again.
To preload these variables from an external source, declare the variables at the top of your program, like this:
|
Global Dim fKX1 As Float Shared Global Dim fKX2 As Float Shared Global Dim fKX3 As Float Shared Global Dim fKY1 As Float Shared Global Dim fKY2 As Float Shared Global Dim fKY3 As Float Shared |
!!!! End older depreciated version using floating point math before version 2.03 !!!!
Created with the Personal Edition of HelpNDoc: Easily create Web Help sites