#include <reg52.h>
#include <stdio.h>
sfr p0=0x80;
sfr p1=0x90 ;
sfr p2=0xa0 ;
sfr p3=0xb0 ;
//以下為字庫
char code XXX[]= {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff};
char code sheng[]={0x00, 0x80, 0x10, 0xc0, 0x10, 0x80, 0x10, 0x88,
0x1f, 0xfc, 0x20, 0x80, 0x20, 0x80, 0x40, 0x88, 0x9f, 0xfc, 0x00,
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x84, 0x7f, 0xfe,
0x00, 0x00};
char code ri[]={0x00, 0x00, 0x1f, 0xf0, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x1f, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0xf0, 0x10, 0x10, 0x00, 0x00,
0x00, 0x00};
char code kuai[]={0x20, 0x80, 0x20, 0x80, 0x20, 0x80, 0x37, 0xf8,
0xa8, 0x88, 0xa8, 0x88, 0xa0, 0x88, 0x2f, 0xfe, 0x20, 0x80, 0x21,
0x40, 0x21, 0x40, 0x21, 0x20, 0x22, 0x10, 0x22, 0x18, 0x24, 0x0e,
0x28, 0x04};
char code le[]={0x00, 0x30, 0x01, 0xf8, 0x1f, 0x00, 0x10, 0x80,
0x10, 0x80, 0x10, 0x80, 0x3f, 0xfc, 0x10, 0x80, 0x08, 0x80, 0x0c,
0x90, 0x18, 0x88, 0x30, 0x8c, 0x24, 0x86, 0x42, 0x84, 0x01, 0x00,
0x00, 0x00};
char code tanhao[]={0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00};
char code hao[]={ 0x10, 0x00, 0x11, 0xfc, 0x10, 0x08, 0x10, 0x10,
0xfc, 0x20, 0x24, 0x20, 0x24, 0x20, 0x27, 0xfe, 0x44, 0x20, 0x64,
0x20, 0x18, 0x20, 0x08, 0x20, 0x14, 0x20, 0x26, 0x20, 0x44, 0xa0,
0x80, 0x40};
char code wo[]={ 0x06, 0x40, 0x38, 0x50, 0x08, 0x48, 0x08, 0x48,
0x08, 0x40, 0xff, 0xfe, 0x08, 0x40, 0x08, 0x48, 0x0e, 0x28, 0x38,
0x30, 0xc8, 0x20, 0x08, 0x50, 0x09, 0x92, 0x08, 0x0a, 0x28, 0x06,
0x10, 0x02};
char code ni[]={0x09, 0x00, 0x09, 0x80, 0x11, 0x04, 0x13, 0xfe,
0x22, 0x04, 0x34, 0x48, 0x68, 0x40, 0xa2, 0x50, 0x23, 0x48, 0x22,
0x48, 0x24, 0x44, 0x24, 0x46, 0x28, 0x44, 0x21, 0x40, 0x20, 0x80,
0x00, 0x00};
char code ai[]={0x00, 0xf8, 0x3f, 0x90, 0x12, 0x10, 0x09, 0x20,
0x3f, 0xfe, 0x22, 0x02, 0x42, 0x00, 0x3f, 0xfc, 0x04, 0x00, 0x07,
0xf0, 0x0c, 0x20, 0x0b, 0x40, 0x10, 0xc0, 0x63, 0x30, 0x8c, 0x0e,
0x30, 0x04} ;
char code liang0[]={0x01, 0x00, 0x00, 0x80, 0x3f, 0xfe, 0x22, 0x04,
0x43, 0x08, 0x02, 0x00, 0x7f, 0xfe, 0x02, 0x00, 0x04, 0x80, 0x04,
0x80, 0x09, 0x00, 0x11, 0x10, 0x22, 0x08, 0x44, 0xfc, 0x0f, 0x88,
0x00, 0x00};
char code
turn1[]={0x42,0x43,0x46,0x44,0x48,0x50,0x60,0xFF,0xE0,0x50,0x68,0x58,0x4C,0x46,0x46,0x01,};
char code
turn2[]={128,0,64,0,32,0,16,0,8,0,4,0,2,0,1,0,0,128,0,64,0,32,0,16,0,8,0,4,0,2,0,1,};
char
*pp0; //指針太有用啦~~
int a,g;
play()
{
int i;
for(i=0;i<16;i++)
{
p1=~pp0[i*2+1];
p0=~pp0[i*2];
p2=(turn2[i*2+1]);
p3=(turn2[i*2]);
} ;i=0;}
int hk=0;
void tm1_irq ()interrupt 3 //定時(shí)器.
{
TH1=0xd8;
TL1=0xef;
++hk ;
if(hk==100)
//利用定時(shí)器每1S后換字符.
{ hk=0;
++a;}
else
;}
void main() //主函數(shù)
{ TH1=0xd8;
TL1=0xef;
TMOD=0x10;
ET1=1;
EA=1;
TR1=1;
a=1;
for(;;)
{ ;
switch (a)
{ case 1 :pp0=XXX;play();break;
case 2 :pp0=XXX;play();break;
case 3:pp0=sheng;play(); break;
case 4:pp0=ri ;play(); break;
case 5:pp0=kuai ;play(); break;
case 6:pp0=le ;play();
break;
case 7:pp0=tanhao ;play(); break;
case 8:pp0=XXX;play()
;break;
case 9:pp0=XXX;play()
;break;
case 10 :pp0=XXX;play();break;
case 11:pp0 = wo ; play();break;
case 12:pp0 = ai ;play();break;
case 13:pp0 = ni ;play();break;
default: a=1;break;}
}}