#include <16F877A.h>
#device adc=8
#fuses HS,NOWDT, NOPROTECT, PUT
#use delay(clock = 20 000 000)
#include <lcd.c>
void main (void)
{
float photo;
setup_adc(ADC_CLOCK_INTERNAL);
setup_adc_ports(ALL_ANALOG);
lcd_init();
while (1)
{
lcd_putc ("\f");
set_adc_channel(0);
delay_us(20);
photo = read_adc();
photo = (photo*.0197)/5*100;
lcd_putc("LIGHT METER");
Printf (lcd_putc);
lcd_putc("\n");
lcd_putc("Light= ");
printf (lcd_putc, "%2.2f", photo);
delay_ms(100);
}
}