/*******************************************************
FILE:     flash_led.c

DESCRIPTION: A first PIC program. Flashes LED attached
to PIC pin. 
Designed for 16f88 PIC chip using internal oscillator. 

REVISION HISTORY:  
*******************************************************/
//--Includes

#include <16f88.h>

//--Setup commands

#fuses INTRC_IO,NOWDT,NOPROTECT,PUT,NOWRT,NOLVP  // internal oscillator
#id 0x1234                     // 4 digit id
#use standard_io(A)
#use standard_io(B)
//#use fast_io(A)
//#use fast_io(B)
#use delay(clock=8000000)      // declare clock speed


//--Pin definitions

#define LED      PIN_B0   // LED


/*******************************************************
  Main starts here
*******************************************************/

void main(void)
{
  int i;
  setup_oscillator(OSC_8MHZ);

//-------Set direction registers

//  set_tris_a(0xFF);   // a is all inputs (for adc)
//  set_tris_b(0xC0);   // b7,b6 in, rest out


//-------Flash led a few times

  for (i=0;i<5;i++) {
    output_high(LED);
    delay_ms(100);
    output_low(LED);
    delay_ms(300);
  }

//-------That's all folks

  sleep();

}


