#include<reg52.h> sbit L4 = P2^0; sbit L3 = P2^1; sbit L2 = P2^2; sbit L1 = P2^3; void main() { int cnt = 0; int i = 0; char k = 0; L4 = 1; L3 = 1; L2 = 1; L1 = 1; while (1) { P2 = 0xFE <<cnt; for (i=0; i < 30000; i++); cnt++; if (cnt >= 4) { while(k != 4) { P2 = 0xF7 >>cnt; for (i=0; i < 30000; i++); cnt++; k++; } cnt = 0; k = 0; } } }