#include <12F675.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES INTRC_IO                 //Internal RC Osc, no CLKOUT
#FUSES NOCPD                    //No EE protection
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOMCLR                   //Master Clear pin used for I/O
#FUSES PUT                      //Power Up Timer
#FUSES BROWNOUT                 //Reset when brownout detected
#FUSES BANDGAP_HIGH          
#use delay(clock=4000000)

#define LED PIN_A1

#int_TIMER0

volatile int8 i=50;
volatile int1 timerflag=0;

void LED_on(void)
{
output_high(LED);
delay_ms(100);
output_low(LED);
}


void  TIMER0_isr(void) 
{
  if(--i==0)
   {
   timerflag=1;
   }
  set_timer0(178);
}



void main()
{

   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256);
   setup_timer_1(T1_DISABLED);
   setup_comparator(NC_NC);
   setup_vref(FALSE);
   clear_interrupt(INT_TIMER0);
   enable_interrupts(INT_TIMER0);
   enable_interrupts(GLOBAL);

  while(1)
  {
      if(timerflag==1)
         {
         LED_on();
         }
  timerflag=0;
  }
}