#include <16f877a.h>
#use delay(clock=20000000)
#fuses hs,noprotect,nowdt,nolvp
#define use_portb_lcd TRUE
#include <lcd.c>
#define PWR_LED Pin_A5
#define IR1 Pin_A0
void main()
{
int interrupt = 0;
lcd_init();
{
if (input(IR1) == True) /this code is used for check H or L using a LED
output_high(PWR_LED);
else
output_low(PWR_LED);
lcd_putc("\fAutomatic Room");
lcd_putc("\nLight Controller");
delay_ms(5000);
lcd_putc("\f");
lcd_gotoxy(1,1);
lcd_putc("People in = \n");
if(input(IR1)==0) / if the input is low
{
interrupt+=1; increment by one
lcd_gotoxy(13,1); display on first row,13th column
lcd_putc(interrupt);
}
}while(1);
}