Processing Touch Input
The method for processing touch input on the CT1820 is slightly different from that of the CT1721C.
The following program shows how to determine when and where a touch event occurs and process it.
'
' Demo for Cutouch
'
#include "CT18XX"
Dim TX1 As Integer, TY1 As Integer
On Pad Gosub TouchInput
'
(1) Attach Interrupt Service Routine
Do
Loop
TounchInput:
TX1 = Sys(10)
'
(2) Start of Interrupt Service Routine
TY1 = Sys(11)
Circlefill TX1,TY1,10
'
(3) Draw a point where touched
Return
(1)
On Pad Gosub TouchInput
: When a touch event occurs, a routine called
TouchInput
will be called
(2) When a touch event occurs, execution will branch to this location. The X and Y coordinates of the
touch can be ready using the
Sys(10)
and
Sys(11)
function calls respectively.
(3) Draw a point on the display at the location where the touch occurred.
This method is different from the CT1721C as described below.
1. Using
Set Pad
is not necessary
2. The
Sys
function call is used instead of
GetPad
to read the touch coordinates.
CT1721C
CT18XX
Set Pad 0,4,5
On Pad Gosub TouchInput
Do
Loop
TouchInput:
Tx = Getpad(2)
Ty = GetPad(2)
Return
On Pad Gosub TouchInput
Do
Loop
TouchInput:
Tx = Sys(10)
Ty = Sys(11)
Return
Comfile Technology, Inc
CT1820 User's Manual
47 Of 93
Содержание CUTOUCH CT1820
Страница 4: ...Chapter 1 Overview Comfile Technology Inc CT1820 User s Manual 4 Of 93 ...
Страница 7: ...The CT1820 s Appearance Comfile Technology Inc CT1820 User s Manual 7 Of 93 ...
Страница 8: ...Comfile Technology Inc CT1820 User s Manual 8 Of 93 ...
Страница 9: ...Comfile Technology Inc CT1820 User s Manual 9 Of 93 ...
Страница 12: ...Comfile Technology Inc CT1820 User s Manual 12 Of 93 ...
Страница 17: ...Comfile Technology Inc CT1820 User s Manual 17 Of 93 ...
Страница 19: ...Chapter 2 I O Comfile Technology Inc CT1820 User s Manual 19 Of 93 ...
Страница 29: ...Comfile Technology Inc CT1820 User s Manual 29 Of 93 ...
Страница 32: ...Chapter 3 Command Reference Comfile Technology Inc CT1820 User s Manual 32 Of 93 ...
Страница 41: ...Chapter 4 Touch Input Comfile Technology Inc CT1820 User s Manual 41 Of 93 ...
Страница 52: ...Chapter 5 ModPort I O Expansion Comfile Technology Inc CT1820 User s Manual 52 Of 93 ...
Страница 61: ...Chapter 6 Sample Programs Comfile Technology Inc CT1820 User s Manual 61 Of 93 ...
Страница 87: ...Chapter 7 Panel Mounting Comfile Technology Inc CT1820 User s Manual 87 Of 93 ...
Страница 88: ...Dimensions Comfile Technology Inc CT1820 User s Manual 88 Of 93 ...
Страница 89: ...Comfile Technology Inc CT1820 User s Manual 89 Of 93 ...
Страница 90: ...Panel Cutout Comfile Technology Inc CT1820 User s Manual 90 Of 93 ...