sbit LCD_RS at RA3_bit;
sbit LCD_RW at RA2_bit;
sbit LCD_EN at RB4_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RE1_bit;
sbit LCD_D7 at RE2_bit;
sbit LCD_RS_Direction at TRISA3_bit;
sbit LCD_RW_Direction at TRISA2_bit;
sbit LCD_EN_Direction at TRISB4_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISE1_bit;
sbit LCD_D7_Direction at TRISE2_bit;
#define L1 PORTC.B3
#define L2 PORTD.B6
#define L3 PORTD.B7
void main()
{
OSCCON = 0b01110000;
ANCON0=0x00;
ANCON1=0x00;
ADCON1=0x7F;
ADCON0.ADON = 0;
TRISA=0X00;
TRISB=0X00;
TRISC=0X00;
TRISD=0X00;
TRISE=0X00;
LCD_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);
while(1){
LCD_Out(1,2,"Hello");
L1 = 1;
delay_ms(1000);
L1 = 0;
L2 = 1;
delay_ms(1000);
L2 = 0;
L3 = 1;
delay_ms(1000);
L3 = 0;
}
}