#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
unsigned char code tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char code taba[]=
{
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x00,0x7c,0x82,0x82,0x82,0x7c,0x00,
0x00,0x00,0x80,0x84,0xfe,0x80,0x80,0x00,
0x00,0x00,0xe4,0xa2,0xa2,0xa2,0x9c,0x00,
0x00,0x00,0x44,0x92,0x92,0x92,0x6c,0x00,
0x00,0x00,0x30,0x28,0x24,0xfe,0x20,0x00,
0x00,0x00,0x4e,0x8a,0x8a,0x8a,0x72,0x00,
0x00,0x00,0x7c,0x92,0x92,0x92,0x64,0x00,
0x00,0x00,0x02,0x02,0xf2,0x0e,0x00,0x00,
0x00,0x00,0x6c,0x92,0x92,0x92,0x6c,0x00,
0x00,0x00,0x4c,0x92,0x92,0x92,0x7c,0x00,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
};
uchar idata Buffer[96]={0}; //缓存显示单元 12*8
uchar i,t;
delay(uchar t)
{
while (t--)
{;}
}
void main(void)
{
uchar N,T,m,n,a;
for(m=0;m<12;m++) //12行
for(n=0;n<8;n++)
Buffer[8*m+n]=taba[7-n+m*8]; //将TAB数组中的数据重新排列
//使得右移字母顺序不变
while(1)
{
for(N=0;N<88;N++) //循环扫描一遍12帧
for(T=0;T<40;T++) //速度 (可变)
{
P3=tab[7-a];
for(i=0;i<8;i++)
{
P0=Buffer[i+N];
if(a==8)
{a=0;}
delay(100);
P3=P3>>1|P3<<7; //扫描起始列为第一列
}
}
}
}