/* LED CHAY TU TRAI SANG PHAI VA NGUOC LAI*/
#include <16f887.h>
#use delay(clock=20000000)
#FUSES HS,nowdt
#BYTE PORTD=0X08
int16 i;
int16 data[15]={128,64,32,16,8,4,2,1,2,4,8,16,32,64,128};
void main() 
{
  set_tris_d(0);
   while(1)
   {
      for(i=0;i<15;i++)
      {
      PORTD=data[i];
      delay_ms(100);
      }
   }

}
