User manual
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
613
Initialize()
Glcd_Fill(0) ‘ Clear GLCD
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)
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 (TRUE)
if (TP_Press_Detect() <> 0) then
‘ After a PRESS is detected read X-Y and convert it to 128x64 space
if (TP_Get_Coordinates(@x_coord, @y_coord) = 0) then
if ((x_coord < 31) and (y_coord < 8)) then
Glcd_Fill(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)
Glcd_V_Line(0,7,0,1)
Glcd_Write_Text(clear_msg,1,0,0)
Glcd_V_Line(0,7,97,1)
if (write_erase) then
Glcd_Write_Text(erase_msg,98,0,0)
else