源代码:
#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
#define data1 P0
#define data2 P2
sbit s1=P3^6;
sbit s2=P3^7;
bit fangxiang;
uint alt=0,net=0,sl=8;
bit mode;
uchar code tab[]={
//
0x00,0x00,0x0C,0x04,0x1C,0x0C,0x18,0x1C,0x10,0x3C,
0x10,0x74,0x10,0xE4,0x11,0xC4,0x13,0xC4,0x17,0x84,
0x1F,0x04,0x1E,0x04,0x1C,0x0C,0x18,0x1C,0x10,0x18,
0x00,0x00,/*"Z",0*/
0x00,0x04,0x00,0x04,0x1F,0xFC,0x1F,0xFC,0x10,0x84,
0x00,0x84,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,
0x00,0x84,0x10,0x84,0x1F,0xFC,0x1F,0xFC,0x00,0x04,
0x00,0x00,/*"H",1*/
0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x34,0x00,0xC4,
0x03,0x40,0x0C,0x40,0x10,0x40,0x1C,0x40,0x0F,0x40,
0x03,0xE4,0x00,0x7C,0x00,0x1C,0x00,0x04,0x00,0x04,
0x00,0x00,/*"A",2*/
0x00,0x04,0x10,0x04,0x1F,0xFC,0x18,0x04,0x1C,0x04,
0x0E,0x00,0x07,0x00,0x03,0x00,0x01,0x80,0x00,0xC0,
0x00,0x60,0x00,0x30,0x10,0x18,0x1F,0xFC,0x10,0x00,
0x00,0x00,/*"N",3*/
0x00,0x00,0x03,0xE0,0x07,0xF0,0x0C,0x38,0x08,0x08,
0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x04,
0x10,0x44,0x10,0x78,0x1C,0x78,0x00,0x40,0x00,0x00,
0x00,0x00,/*"G",4*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,/*" ",5*/
0x00,0x00,0x03,0xE0,0x07,0xF0,0x0E,0x38,0x08,0x18,
0x10,0x14,0x10,0x24,0x10,0x24,0x10,0x14,0x10,0x1C,
0x10,0x0E,0x08,0x0A,0x0E,0x3A,0x07,0xF2,0x03,0xE0,
0x00,0x00,/*"Q",6*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x10,0x04,
0x10,0x04,0x10,0x04,0x1F,0xFC,0x1F,0xFC,0x10,0x04,
0x10,0x04,0x10,0x04,0x00,0x04,0x00,0x00,0x00,0x00,
0x00,0x00,/*"I",7*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,/*" ",8*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x08,0x04,0x08,0x04,0x0F,0xFC,0x1F,0xFC,0x00,0x04,
0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,
0x00,0x00,/*"1",9*/
0x00,0x00,0x00,0x00,0x0C,0x00,0x18,0x00,0x10,0x00,
0x10,0x00,0x10,0x3C,0x10,0x7C,0x10,0xC8,0x11,0x00,
0x12,0x00,0x14,0x00,0x18,0x00,0x10,0x00,0x00,0x00,
0x00,0x00,/*"7",10*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,/*" ",11*/
0x00,0x00,0x00,0x00,0x1F,0xF8,0x11,0x10,0x11,0x10,
0x11,0x10,0x11,0x10,0xFF,0xFE,0x11,0x11,0x11,0x11,
0x11,0x11,0x11,0x11,0x1F,0xF9,0x00,0x01,0x00,0x0F,
0x00,0x00,/*"电",0*/
0x04,0x00,0x08,0x00,0x32,0x00,0xE2,0x00,0x2A,0x00,
0x2A,0x00,0x2A,0x00,0x2A,0x00,0x2A,0x00,0x2A,0x00,
0x2A,0x00,0x2B,0xF0,0x20,0x0C,0x20,0x02,0x00,0x0F,
0x00,0x00,/*"气",1*/
0x00,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,
0x20,0x04,0x20,0x04,0x3F,0xFC,0x20,0x04,0x20,0x04,
0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x00,0x04,
0x00,0x00,/*"工",2*/
0x24,0x10,0x24,0x60,0x25,0x80,0x7F,0xFF,0xC4,0x80,
0x44,0x60,0x00,0x02,0x7C,0x92,0x44,0x92,0x44,0x92,
0x44,0xFE,0x44,0x92,0x44,0x92,0x7C,0x92,0x00,0x82,
0x00,0x00,/*"程",3*/
0x00,0x01,0x00,0x02,0x40,0x0C,0x40,0x30,0x7F,0xC1,
0x42,0x01,0x41,0x82,0x40,0x62,0x42,0x14,0x4E,0x08,
0x72,0x14,0x02,0x62,0x03,0x82,0x00,0x01,0x00,0x01,
0x00,0x00,/*"及",4*/
0x00,0x10,0x20,0x10,0x20,0x11,0x20,0x12,0xFF,0xF4,
0x24,0x90,0x24,0x90,0x24,0x90,0x24,0x90,0x24,0x90,
0xFF,0xF4,0x20,0x12,0x20,0x11,0x20,0x10,0x00,0x10,
0x00,0x00,/*"其",5*/
0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0x11,0x22,
0x31,0x22,0x51,0x22,0x91,0x22,0x11,0x22,0x11,0x22,
0x11,0x22,0x1F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,/*"自",6*/
0x02,0x08,0x22,0x3C,0x23,0xC8,0x22,0x08,0x22,0x28,
0x22,0x1D,0x02,0x02,0x08,0x0C,0x08,0x70,0xFF,0x80,
0x08,0x02,0x08,0x01,0x08,0x02,0x0F,0xFC,0x00,0x00,
0x00,0x00,/*"动",7*/
0x00,0x80,0x01,0x00,0x06,0x00,0x1F,0xFF,0xE0,0x00,
0x00,0x20,0x00,0x40,0x00,0x80,0xFF,0xFC,0x02,0x02,
0x04,0x02,0x08,0x02,0x10,0x02,0x20,0x02,0x00,0x1E,
0x00,0x00,/*"化",8*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,
0x18,0x18,0x20,0x04,0x40,0x02,0x00,0x00,0x00,0x00,
0x00,0x00,/*"(",9*/
0x00,0x00,0x0C,0x18,0x10,0x04,0x10,0x84,0x10,0x84,
0x11,0x44,0x0E,0x38,0x00,0x00,/*"3",10*/
0x00,0x00,0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,
0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,/*")",11*/
};
void delay(uint z)
{
uchar x;
for(;z>0;z--)
for(x=30;x>0;x--);
}
void xianshi()
{
uchar aa,i;
for(i=0;i<16;i++)
{
P1=i;
data1=tab[net+aa];
aa++;
data2=tab[net+aa];
aa++;
delay(5);
data1=0;
data2=0;
P1=0x00;
if(aa>30) aa=0;
}
}
void main()
{
ET1=1;
EA=1;
TR1=1;
while(1)
{
xianshi();
if(s1==0)
{
delay(30);
TR1=~TR1;
while(!s1)xianshi();
delay(30);
}
if(s2==0)
{
delay(30);
fangxiang=~fangxiang;
while(!s2)xianshi();
delay(30);
}
}
}
void timer1() interrupt 3
{
alt++;
if(alt==10)
{
alt=0;
if(fangxiang==0)
{
net=net+2;
if(net>sl)
net=0;
}
else
{
net=net-2;
if(net<2)
net=sl;
}
}
}
全部资料51hei下载地址:
新建 WinRAR ZIP 压缩文件.zip
(27.82 KB, 下载次数: 23)
|