#include "C:\RS\kaki\try\mainer.h"

#define PIP1 output_high(PIN_C4)
#define PIP2 output_low(PIN_C5)

void main()
{

unsigned int8 poc;
int8 delay;
int16 cas;

   setup_adc_ports(AN0);
   setup_adc(ADC_CLOCK_DIV_2);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1);
   setup_timer_1(T1_INTERNAL|T1_DIV_BY_1);
   setup_timer_2(T2_DIV_BY_1,255,1);
   setup_ccp1(CCP_PWM);
   setup_ccp2(CCP_PWM);
   set_pwm1_duty(0);
   set_pwm2_duty(0);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   
   set_timer0(0);   

   while(TRUE)
   {
      delay=read_adc();
      set_pwm1_duty(delay);
      set_pwm2_duty(delay); 
      
     cas++;
     
    // b=cas/20;
    // b++;

     poc=get_timer0();
   if (poc!=poc)
    {
      poc++;   
      PIP1;
      PIP2;
     delay_ms(10);
     !PIP1;
     !PIP2;
     delay_ms(10);
   
    }    
         
             if(cas>=65535)
               {
                        
               printf("\n\r");
               printf("Hello world!\n\r");
                        
               printf("%u",poc+1);
               //set_timer0(0);   
               }        
      
         
   }

}