#include
#define uchar unsigned char
sbit key=P1^0;
uchar led;
void delay(uchar x)
{
uchar i,j;
for(i=0;i
}
void disled()
{
uchar i,j;
led=0xfe;
for(j=0;j<2;j++)
{
for(i=0;i<8;i++)
{
P0=led;
delay(200);
P0=0xff;
delay(200);
led<<=1;
led|=0x01;
}}
for(i=0;i<2;i++)
{
P0=0x00;
delay(200);
P0=0xff;
delay(200);
}
P0=0xff;
}
main()
{
while(1)
{
if(key==0)
delay(10);
if(key==0)
{
disled();
}
}
}