User manual

613
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
if (write_erase) then
Glcd_Write_Text(erase_msg,98,0,0)
else
Glcd_Write_Text(write_msg,98,0,0);
end;
// If write/erase is pressed
if ((x_coord > 96) and (y_coord < 8)) then
begin
if (write_erase) then
begin
write_erase := 0;
Glcd_Write_Text(write_msg,98,0,0);
Delay_ms(500);
end
else
begin
write_erase := 1;
Glcd_Write_Text(erase_msg,98,0,0);
Delay_ms(500);
end;
end;
// If pen size is selected
if ((x_coord >= 41) and (x_coord <= 52) and (y_coord <= 9)) then
pen_size := 3;
if ((x_coord >= 63) and (x_coord <= 70) and (y_coord <= 7)) then
pen_size := 2;
if ((x_coord >= 80) and (x_coord <= 86) and (y_coord <= 6)) then
pen_size := 1;
if (y_coord < 11) then
continue;
case pen_size of
1: if ( (x_coord >= 0) and (y_coord >= 0) and (x_coord <= 127) and (y_
coord <= 63) ) then
Glcd_Dot(x_coord, y_coord, write_erase);
2: if ( (x_coord >= 0) and (y_coord >= 0) and (x_coord <= 127-1) and
(y_coord <= 63-1) ) then
Glcd_Box(x_coord, y_coord, x_coord + 1, y_coord + 1, write_
erase);
3: if ( (x_coord >= 1) and (y_coord >= 1) and (x_coord <= 127-2) and
(y_coord <= 63-2) ) then
Glcd_Box(x_coord-1, y_coord-1, x_coord + 2, y_coord + 2, write_
erase);
end;
end;
end;
end;
end.