#include <main.h>

void kitt(void);							// define functions/subroutines

unsigned int i;
unsigned int hex_valuea;
unsigned int hex_valueb;

void main()
{  
   set_tris_a(0x00);
   set_tris_b(0x00);

   while (true){
      kitt();}
}

void kitt(void)
{      
       i=7;
       hex_valueb = 0x01;
       while (i>0){
	  output_b(hex_valueb);
	  hex_valueb = hex_valueb * 0x02;
	  i= i-1;			    
	  delay_ms(150);}
       output_b(0x00);
       i=7;
       hex_valuea = 0x01;
       while (i>0){
	  output_a(hex_valuea);
	  hex_valuea = hex_valuea * 0x02;
	  i= i-1;			    
	  delay_ms(150);}
       output_a(0x00);
       i=8;
       while (i>0){
	  output_a(hex_valuea);
	  hex_valuea = hex_valuea / 0x02;
	  i= i-1;						    
	  delay_ms(150);}
       output_a(0x00);
       i=8;
       while (i>0){
	  output_b(hex_valueb);
	  hex_valueb = hex_valueb / 0x02;
	  i= i-1;						    
	  delay_ms(150);}
       output_b(0x00);
}