#include<at89c51.h>
#include<math.h>
#include<atmel/at89x51.h>
char i,j;
char code a[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
void delay(void)
{
unsigned int i;
for(i=0;i<20000;i++)
{
}
}
void main(void)
{
EA=1;
EX0=1;
IT0=1;
while(1)
{
j=7;
i=0;
for (i=0;i<8;i++)
{
P2=a;
delay();
}
}
}
void int0() interrupt0
{
for (j=7;j>=0;j--)
{
P2=a;
}
}
|