Set OnPad On|Off
At power on, Set OnPad is On by default.
This command turns on or off the ability to receive On Pad interrupts.
When Set OnPad is On, the interrupt service routine (ISR) set using the On Pad command will be executed when the corresponding interrupt occurs. If Set OnPad is Off, then the ISR will not be executed when the interrupt occurs. See also the Set Pad and On Pad commands.
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.