Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
617
TP_TFT_Press_Detect
Prototype
sub function TP_TFT_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: 
DriveX_Left
: DriveX_Left pin. 
DriveX_Right
: DriveX_Right pin. 
DriveY_Up
: DriveY_Up pin. 
DriveY_Down
: DriveY_Down pin. 
DriveX_Left_Direction
: Direction of DriveX_Left pin. 
DriveX_Right_Direction
: Direction of DriveX_Right pin. 
DriveY_Up_Direction
: Direction of DriveY_Up pin. 
DriveY_Down_Direction
: Direction of DriveY_Down pin. 
must be defined before using this function.
Example
‘ Touch Panel module connections
dim DriveX_Left as sbit at LATB13_bit
    DriveX_Right as sbit at LATB11_bit
    DriveY_Up as sbit at LATB12_bit
    DriveY_Down as sbit at LATB10_bit
    DriveX_Left_Direction as sbit at TRISB13_bit
    DriveX_Right_Direction as sbit at TRISB11_bit
    DriveY_Up_Direction as sbit at TRISB12_bit
    DriveY_Down_Direction as sbit at TRISB10_bit
‘ End Touch Panel module connections
if (TP_TFT_Press_Detect() <> 0) then
  ...
end if
Notes
None.