WDW


  

void main()

{

int j = 0;

int p = 0;

  cmcon == 0x07;

   TRISA = 0xFF;

   TRISB = 0x00;

   PORTB 0 ;

   }

   while(1) {

   if (PORTA.F0 == 0 ) {


   do{

     PORTB.F0 = 1;

     deiay_ms (300);

     PORTB.F1 = 1;

     deiay_ms (300);

     PORTB.F2 = 1;

     deiay_ms (300);

     PORTB = 0;

     j++;

     }

     while (i<5);

      }

   if (PORTA.F1 == 0 ) {


   do{

     PORTB.F0 = 1;

     deiay_ms (300);

     PORTB.F1 = 1;

     deiay_ms (300);

     PORTB.F2 = 1;

     deiay_ms (300);

     PORTB = 0;

     p++;

     }

     while (i<5);

      }


      }

      }

ความคิดเห็น