#include <main.h>
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
#define ccp1 PIN_C2
#define ccp2 PIN_C1
#define en PIN_C4

#include <lcd4bit.c>
//UNSIGNED int8 ctimer=0;
float tocdo=0, tocdodat;
float xung=0, xungmoi = 0,xungcu =0 ;
float dem = 0, w=0;
void ngatkenhA();
void NGAT_TIMER1();
float xung21(FLOAT);
#INT_TIMER1
void NGAT_TIMER1()
{
IF(dem >= 4)
{
disable_interrupts (INT_EXT) ;
setup_timer_1 (T1_DISABLED) ;
tocdo = 3.45 * xungmoi;
xungmoi = 0;
set_timer1 (15535) ;
setup_timer_1 (T1_INTERNAL|T1_DIV_BY_1) ;
enable_interrupts (INT_EXT) ;
dem = 0;
}
#INT_TIMER1
void NGAT_TIMER1()
{
IF(dem >= 4)
{
disable_interrupts (INT_EXT) ;
setup_timer_1 (T1_DISABLED) ;
tocdo = 3.45 * xungmoi;
xungmoi = 0;
set_timer1 (15535) ;
setup_timer_1 (T1_INTERNAL|T1_DIV_BY_1) ;
enable_interrupts (INT_EXT) ;
dem = 0;
}
dem = dem + 1;
w = tocdo;
}
void main()
{

   while(TRUE)
   {
      //TODO: User Code
   }

}
