User manual
640
mikoC PRO for dsPIC
MikroElektronika
Glcd_Dot(0,63,0); // Clear bottom left dot
Glcd_Dot(127,0,1); // Draw upper right dot
Glcd_Write_Text(“ “,12,3,1);
Glcd_Write_Text(“TOUCH UPPER RIGHT”,12,4,1);
TP_Calibrate_Upper_Right(); // Calibration of upper right corner
Delay_ms(1000);
}
void main() {
Initialize();
Glcd_Write_Text(“CALIBRATION”,12,3,1);
Delay_ms(1000);
Glcd_Fill(0); // Clear GLCD
Calibrate();
Glcd_Fill(0);
Glcd_Write_Text(“WRITE ON SCREEN”, 20, 5, 1) ;
Delay_ms(1000);
Glcd_Fill(0); // Clear GLCD
Glcd_V_Line(0,7,0,1);
Glcd_Write_Text(clear_msg,1,0,0);
Glcd_V_Line(0,7,97,1);
Glcd_Write_Text(erase_msg,98,0,0);
// Pen Menu:
Glcd_Rectangle(41,0,52,9,1);
Glcd_Box(45,3,48,6,1);
Glcd_Rectangle(63,0,70,7,1);
Glcd_Box(66,3,67,4,1);
Glcd_Rectangle(80,0,86,6,1);
Glcd_Dot(83,3,1);
write_erase = 1;
pen_size = 1;
while (1) {
if (TP_Press_Detect()) {
// After a PRESS is detected read X-Y and convert it to 128x64 space
if (TP_Get_Coordinates(&x_coord, &y_coord) == 0) {
if ((x_coord < 31) && (y_coord < 8)) {
Glcd_Fill(0);