// LCD module connections
sbit LCD_RS at Rc4_bit;
sbit LCD_EN at Rc5_bit;
sbit LCD_D4 at Rc0_bit;
sbit LCD_D5 at Rc1_bit;
sbit LCD_D6 at Rc2_bit;
sbit LCD_D7 at Rc3_bit;
sbit LCD_RS_Direction at TRISc4_bit;
sbit LCD_EN_Direction at TRISc5_bit;
sbit LCD_D4_Direction at TRISc0_bit;
sbit LCD_D5_Direction at TRISc1_bit;
sbit LCD_D6_Direction at TRISc2_bit;
sbit LCD_D7_Direction at TRISc3_bit;
// End LCD module connections
void main(){
trisb=255;
trisd=0;
portd=0;
while(1){
lcd_init();
lcd_cmd(_lcd_cursor_off);
lcd_out(1,1,"IEC DEP. CONTROL");
delay_ms(1000);
lcd_out(2,1,"mh");
delay_ms(1000);
lcd_cmd(_lcd_clear);
delay_ms(250);
if(portb.B0==0){portd=0x2a ;DELAY_MS(300);lcd_out(1,1,"increment");
delay_ms(3000);lcd_cmd(_lcd_clear);
delay_ms(250); }
if(portB.B1==0){portd=0x23 ;DELAY_MS(300);lcd_out(1,1,"decrement");
delay_ms(3000);lcd_cmd(_lcd_clear);
delay_ms(250); }
if(portB.B2==0){portd=0x0e ;DELAY_MS(300);lcd_out(1,2,"start"); delay_ms(3000);
lcd_cmd(_lcd_clear);
delay_ms(250); }
if(portB.B3==0){portd=0x1c ;DELAY_MS(300);lcd_out(1,1,"stop");
delay_ms(3000);lcd_cmd(_lcd_clear);
delay_ms(250); }
if(portB.B4==0){portd=0x15 ;DELAY_MS(300);lcd_out(1,1,"shoot");
delay_ms(3000);lcd_cmd(_lcd_clear);
delay_ms(250);}
if(portB.B5==0){portd=0x31 ; DELAY_MS(300);}