// Global Variables const unsigned char MSG0[20] = "LCD Clock.C "; // Subroutine Declarations #include // Subroutines #include "lcd_portd.c" // Main Routine void main(void) { unsigned int MIN, SEC; unsigned int i; TRISA = 0; TRISB = 0; TRISC = 0; TRISD = 0; TRISE = 0; ADCON1 = 0x0F; LCD_Init(); // initialize the LCD MIN = 0; SEC = 0; LCD_Move(0,0); for (i=0; i<20; i++) LCD_Write(MSG0[i]); Wait_ms(100); while(1) { LCD_Move(1,0); LCD_Out(MIN,2,0); LCD_Write(':'); LCD_Out(SEC,3,1); SEC = SEC + 1; RA0 = 1; Wait_ms(100); RA0 = 0; } }