ABL electronic PIC16 Personal Computer User Manual


 
MikroElektronika:
Development
tools
-
Books
-
Compilers
21 7
page
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
Library Example
The following drawing demo tests advanced routines of GLCD library.
unsigned short j, k;
void main() {
Glcd_Init(PORTB, 2, 0, 3, 5, 7, 1, PORTD);
do {
// Draw circles
Glcd_Fill(0);
// Clear screen
Glcd_Write_Text("Circles", 0, 0, 1);
j = 4;
while (j < 31) {
Glcd_Circle(63, 31, j, 2);
j += 4;
}
Delay_ms(4000);
// Draw boxes
Glcd_Fill(0);
// Clear screen
Glcd_Write_Text("Rectangles", 0, 0, 1);
j = 0;
while (j < 31) {
Glcd_Box(j, 0, j + 20, j + 25, 2);
j += 4;
}
Delay_ms(4000);
// Draw Lines
Glcd_Fill(0);
// Clear screen
Glcd_Write_Text("Lines", 0, 0, 1);
for (j = 0; j < 16; j++) {
k = j*4 + 3;
Glcd_Line(0, 0, 127, k, 2);
}
for (j = 0; j < 31; j++) {
k = j*4 + 3;
Glcd_Line(0, 63, k, 0, 2);
}
Delay_ms(4000);
} while (1);
}//~!