#include <nhietdo.h>
#include <lcd4bit.c>
#fuses HS
#fuses nowdt,noprotect,nolvp,xt,put
#use rs232(baud = 9600, parity = n, xmit = pin_c6, rcv = pin_c7, bits = 8)
#define ccp2 PIN_C2
#INT_TIMER1

int e;
long adc;
char dat;
unsigned int8 nhietdo;
#int_rda
void rda_isr()
      {
      dat = getc();
      
      }
void main()
{
setup_adc_ports(sAN1);
setup_adc(ADC_CLOCK_INTERNAL ); 
set_adc_channel(1); 
delay_ms(10);
lcd_init(); 
while(true)
{
adc=read_ADC();
nhietdo=adc*0.49;
lcd_putcmd(0xc0); 
printf(lcd_putchar,"ADC=%ld%c%c",adc,' ',' ');
lcd_putcmd(0x80); 
printf(lcd_putchar,"Nhiet do=%u%c%c",nhietdo,' ',' '); 

}
}

