Touch.inc
Touch.inc includes the following user-friendly procedures:
Global Input-Output Variables, Created and Used by Touch.inc for Use in the User Program:
• wTouchToPointX (As Word)
• wTouchToPointY (As Word)
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.
• fKX1, fKX2, fKX3, fKY1, fKY2, fKY3 (As Float)
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 so:
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 |
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-by-Step Guide