#include <reg51.h>
void delay(void);
unsigned char string[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
void main(void)
{
unsigned char *p;
while(1)
{
for(p=string;p<(string+8);p++)
{
P1=*p;
delay();
}
P1=0x00;
delay();
P1=0xff;
delay();
P1=0x00;
delay();
P1=0xff;
for(p=(string+7);p>=string;p--)
{
P1=*p;
delay();
}
P1=0x00;
delay();
P1=0xff;
delay();
P1=0x00;
delay();
P1=0xff;
for(p=string;p<(string+8);p+=2)
{
P1=*p;
delay();
}
P1=0x00;
delay();
P1=0xff;
delay();
P1=0x00;
delay();
P1=0xff;
for(p=(string+7);p>=string;p-=2)
{
P1=*p;
delay();
}
delay();
P1=0x00;
P1=0xff;
delay();
P1=0x00;
delay();
P1=0xff;
}
}
void delay(void)
{
int i,j;
for(i=50;i>0;i--)
for(j=1000;j>0;j--)
{;}
}