User Tools

Site Tools



Set OnPad

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.

CT1820 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
    TX1 = Sys(10)            ' (2) Start of Interrupt Service Routine
    TY1 = Sys(11)
    Circlefill TX1,TY1,10    ' (3) Draw a point where touched

(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.

Go CUBLOC home

cubloc/set_onpad/index.txt · Last modified: 2016/07/17 21:17 by COMFILE Technology