#include <REG52.H>
DELAY(unsigned int a);
main()
{unsigned int i,b[]={0xff,0xfe,0xfd,0xfc,0xfb,0xfa,0xf9,0xf8,0xf7,0xf6,0xf5,0xf4,0xf3,0xf2,0xf1,0xf0};
while(1)
{
while(P3^2==0)
{for(i=0;i<16;i++)
{P1=b[i];
DELAY(1000);
while(P3^3==0)
P2=8;
while(P3^4==0)
P2=0;
}
}
}
}
DELAY(unsigned int a)
{unsigned int i,j;
for(i=1;i<a;i++)
for(j=1;j<120;j++);
}