#include <reg52.h>
unsigned int n=64;
unsigned char code b1[50];
unsigned int j,k,sw;
unsigned char code pv[]={
0x00,0x12,0x00,0x22,0x7D,0xD2,0x54,0x92,0x54,0x92,0x54,0x92,0x54,0x92,0x57,0xFE,
0x54,0x92,0x54,0x92,0x54,0x92,0x54,0xB2,0xFD,0x92,0x40,0x86,0x00,0x02,0x00,0x00,
0x00,0x80,0x01,0x00,0x02,0x01,0x04,0x02,0x19,0x04,0x61,0xF8,0x01,0x00,0x01,0x02,
0xC1,0x01,0x31,0x02,0x09,0xFC,0x04,0x00,0x03,0x00,0x01,0x80,0x01,0x00,0x00,0x00,
0x00,0x04,0x80,0x04,0xD0,0x15,0xA7,0xD5,0xA5,0x56,0x85,0x7C,0xFD,0x54,0x07,0xD4,
0xD5,0x54,0xA5,0x7C,0xA5,0x56,0x87,0xD5,0xF8,0x14,0x00,0x04,0x00,0x04,0x00,0x00,
0x13,0x10,0x1D,0x18,0xF1,0x10,0x17,0xFF,0x31,0x20,0x13,0x01,0x04,0x01,0x08,0x92,
0x31,0x12,0xC2,0x24,0x34,0x44,0x08,0x88,0x08,0x10,0x04,0x00,0x04,0x00,0x00,0x00
};
void Delay_100Us(unsigned int tt)
{
unsigned char ii;
for(;tt>0;tt--)
for(ii=94;ii>0;ii--);
}
void intersvr0(void) interrupt 0 using 1
{
unsigned int i;
sw=~sw;
if (sw==0)
{
do {
P0=~b1[j];P2=~b1[j];
j=j-1;
P2=0xff;P0=0xff;
}
while(j);
for(i=0;i<n;i++)
{
P2=~pv[i*2];P0=~pv[1+i*2];
Delay_100Us(5);
P2=0xff;P0=0xff;
}
k=0;
do
{
k=k+1;
P0=~b1[k];P1=~b1[k];
P2=0xff;P0=0xff;
}
while(k<=10);
}
else
{
do{
P0=~b1[k];P2=~b1[k];
k=k-1;
P2=0xff;P0=0xff;
}
while(k);
for(i=0;i<n;i++)
{
P0=~pv[127-i*2];P2=~pv[126-i*2];
Delay_100Us(5);
P2=0xff;P0=0xff;
}
j=0;
do{j=j+1;
P0=~b1[j];P1=~b1[j];
P2=0xff;P0=0xff;
}
while(j<=10);
}
}
void main(void)
{
IT0=1;EX0=1;
EA=1;
j=50;k=50;
sw=0;
P0=0xff;P2=0xff;
while(1);
}
|