User manual

614
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Glcd_Write_Text(write_msg,98,0,0)
end if
end if
‘ If write/erase is pressed
if ((x_coord > 96) and (y_coord < 8)) then
if (write_erase) then
write_erase = 0
Glcd_Write_Text(write_msg,98,0,0)
Delay_ms(500)
else
write_erase = 1
Glcd_Write_Text(erase_msg,98,0,0)
Delay_ms(500)
end if
‘ If pen size is selected
if ((x_coord >= 41) and (x_coord <= 52) and (y_coord <= 9)) then
pen_size = 3
end if
if ((x_coord >= 63) and (x_coord <= 70) and (y_coord <= 7)) then
pen_size = 2
end if
if ((x_coord >= 80) and (x_coord <= 86) and (y_coord <= 6)) then
pen_size = 1
end if
if (y_coord < 11) then
continue
end if
select case pen_size
case 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)
end if
case 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)
end if
case 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 if
end select
end if
end if
wend
end.