User manual
mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
608
TP_Press_Detect
Prototype
function TP_Press_Detect() : 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 dened before using this function.
Example
// Touch Panel module connections
var DriveA : sbit at LATC13_bit;
DriveB : sbit at LATC14_bit;
DriveA_Direction : sbit at TRISC13_bit;
DriveB_Direction : sbit at TRISC14_bit;
// End Touch Panel module connections
if (TP_Press_Detect() <> 0) then
begin
...
end;
Notes None.
TP_Get_Coordinates
Prototype
function TP_Get_Coordinates(x_coordinate : ^word; y_coordinate : ^word) :
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
begin
...
end;
Notes None.