Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
609
TP_Press_Detect
Prototype
sub function TP_Press_Detect() as byte
Description Detects if the touch panel has been pressed.
Parameters None. 
Returns
1
 - if touch panel is pressed. 
-
 0
 - otherwise. 
Requires
Global variables: 
DriveA:
 DriveA. 
DriveB:
 DriveB. 
DriveA_Direction: 
Direction of DriveA pin. 
DriveB_Direction:
 Direction of DriveB pin. 
must be defined before using this function.
Example
‘ Touch Panel module connections
dim DriveA as sbit at LATC13_bit
    DriveB as sbit at LATC14_bit
    DriveA_Direction as sbit at TRISC13_bit
    DriveB_Direction as sbit at TRISC14_bit
‘ End Touch Panel module connections
if (TP_Press_Detect() <> 0) then
  ...
end if
Notes
None.
TP_Get_Coordinates
Prototype
sub function TP_Get_Coordinates(dim byref x_coordinate as word, dim byref 
y_coordinate as word) as byte
Description Get touch panel coordinates and store them in 
x_coordinate
 and 
y_coordinate
 parameters.
Parameters 
x_coordinate:
 x coordinate of the place of touch. 
y_coordinate:
 y coordinate of the place of touch. 
Returns
1
 - if reading is within display dimension range.  
-
 0
 - if reading is out of display dimension range.  
Requires
Nothing.
Example
if (TP_Get_Coordinates(@x_coord, @y_coord) = 0) then
  ...
end if
Notes
None.