#include <reg51.h>
void delay(void) { //while循环方式 unsigned char i=200; unsigned char j=200; while (i--) while(j--); /* //for循环方式 unsigned char i = 200; unsigned char j = 200; for (i=200 ;i>0;i--) for(j=200; j>0 ;j--); */ }
void main(void) { while(1) { unsigned char p = 0x01; unsigned char q; for ( q = 0 ; q < 8 ; q++) { P0 = ~(p << q); delay(); }
}
}