mikroElektronika PIC Microcontrollers PIC12 User Manual page 225

Mikroc user's manual
Table of Contents

Advertisement

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);
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);
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);
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);
}//~!
MikroElektronika: Development tools - Books - Compilers
mikroC - C Compiler for Microchip PIC microcontrollers
// Clear screen
// Clear screen
// Clear screen
page
217

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents