1、#include#define uchar unsigned charuchar t,i,k,a,s;sbit d1=P04;sbit d2=P06;sbit q0=P00;sbit q1=P01;sbit q2=P02;sbit q3=P03;sbit key=P05;void delay(uchar z)uchar x,y;for(x=z;x0;x-)for(y=11;y0;y-);void yi()P0=0xff;d1=0;d2=1;P1=0xa5;delay(8);P1=0xb5;delay(8);P1=0xc5;delay(8);P1=0xd5;delay(8);P1=0xe5;de
2、lay(8);P1=0xf5;delay(8);void er()P0=0xff;d1=1;d2=0;P1=0x00;delay(8);P1=0x03;delay(8);P1=0x04;delay(8);P1=0x07;delay(8);P1=0x0e;delay(8);P1=0x0e;delay(8);P1=0x0f;delay(8);d1=0;d2=1;P1=0x00;delay(8);P1=0x10;delay(8);P1=0x20;delay(8);P1=0x30;delay(8);P1=0x50;delay(8);P1=0x90;delay(8);P1=0xa0;delay(8);P
3、1=0xc0;delay(8);P1=0xf0;delay(8);void san()P0=0xff;d1=1;d2=0;P1=0x00;delay(8);P1=0x03;delay(8);P1=0x04;delay(8);P1=0x07;delay(8);P1=0x0e;delay(8);d1=0;d2=1;P1=0x00;delay(8);P1=0x10;delay(8);P1=0x20;delay(8);P1=0x30;delay(8);P1=0x40;delay(8);P1=0x50;delay(8);P1=0x90;delay(8);P1=0xa0;delay(8);P1=0xc0;
4、delay(8);P1=0xf0;delay(8);void si()P0=0xff;d1=1;d2=0;P1=0x00;delay(8);P1=0x01;delay(8);P1=0x02;delay(8);P1=0x03;delay(8);P1=0x07;delay(8);d1=0;d2=1;P1=0x00;delay(8);P1=0x10;delay(8);P1=0x20;delay(8);P1=0x30;delay(8);P1=0x40;delay(8);P1=0x50;delay(8);P1=0xc0;delay(8);void qi()P0=0xff;d1=1;d2=0;P1=0x0
5、3;delay(8);P1=0x04;delay(8);d1=0;d2=1;P1=0x00;delay(8);P1=0x10;delay(8);P1=0x20;delay(8);P1=0x30;delay(8);P1=0x40;delay(8);P1=0x50;delay(8);P1=0xf0;delay(8);void ba()P0=0xff;d1=1;d2=0;P1=0x00;delay(8);P1=0x01;delay(8);P1=0x02;delay(8);P1=0x03;delay(8);P1=0x04;delay(8);P1=0x07;delay(8);P1=0x0e;delay(
6、8);P1=0x0e;delay(8);P1=0x0f;delay(8);d1=0;d2=1;P1=0x00;delay(8);P1=0x10;delay(8);P1=0x20;delay(8);P1=0x30;delay(8);P1=0x40;delay(8);P1=0x50;delay(8);P1=0x90;delay(8);P1=0xa0;delay(8);P1=0xc0;delay(8);P1=0xf0;delay(8);void jiu()P0=0xff;d1=1;d2=0;P1=0x00;delay(8);P1=0x01;delay(8);P1=0x02;delay(8);P1=0
7、x03;delay(8);P1=0x04;delay(8);P1=0x07;delay(8);P1=0x0e;delay(8);P1=0x0e;delay(8);d1=0;d2=1;P1=0x00;delay(8);P1=0x10;delay(8);P1=0x20;delay(8);P1=0x30;delay(8);P1=0x40;delay(8);P1=0x50;delay(8);P1=0x90;delay(8);P1=0xa0;delay(8);P1=0xc0;delay(8);P1=0xf0;delay(8);void bayiqi()switch(t)case 0: P0=0xff;P
8、2=0xfe;ba();break;delay(1);case 1: P2=0xfd;ba();break;delay(1);case 2: P2=0xfb;ba();break;delay(1);case 3: P2=0xf7;ba();break;delay(1);case 4: P2=0xef;ba();break;delay(1);case 5: P2=0xf7;ba();break;delay(1);case 6: P2=0xfb;ba();break;delay(1);case 7: P2=0xfd;ba();break;delay(1);case 8: P2=0xfe;ba();
9、break;delay(1);case 9: P2=0xfe;yi();break;delay(1);case 10: P2=0xfd;yi();break;delay(1);case 11: P2=0xfb;yi();break;delay(1);case 12: P2=0xf7;yi();break;delay(1);case 13: P2=0xef;yi();break;delay(1);case 14: P2=0xf7;yi();break;delay(1);case 15: P2=0xfb;yi();break;delay(1);case 16: P2=0xfd;yi();break
10、;delay(1);case 17: P2=0xfe;yi();break;delay(1);case 18: P2=0xfe;qi();break;delay(1);case 19: P2=0xfd;qi();break;delay(1);case 20: P2=0xfb;qi();break;delay(1);case 21: P2=0xf7;qi();break;delay(1);case 22: P2=0xef;qi();break;delay(1);case 23: P2=0xf7;qi();break;delay(1);case 24: P2=0xfb;qi();break;del
11、ay(1);case 25: P2=0xfd;qi();break;delay(1);case 26: P2=0xfe;qi();break;delay(1);void yisanyisi()switch(t)case 0: P0=0xff;P2=0xfe;yi();break;delay(1);case 1: P2=0xfd;yi();break;delay(1);case 2: P2=0xfb;yi();break;delay(1);case 3: P2=0xf7;yi();break;delay(1);case 4: P2=0xef;yi();break;delay(1);case 5:
12、 P2=0xf7;yi();break;delay(1);case 6: P2=0xfb;yi();break;delay(1);case 7: P2=0xfd;yi();break;delay(1);case 8: P2=0xfe;yi();break;delay(1);case 9: P2=0xfe;yi();break;delay(1);case 10: P2=0xfd;san();break;delay(1);case 11: P2=0xfb;san();break;delay(1);case 12: P2=0xf7;san();break;delay(1);case 13: P2=0
13、xef;san();break;delay(1);case 14: P2=0xf7;san();break;delay(1);case 15: P2=0xfb;san();break;delay(1);case 16: P2=0xfd;san();break;delay(1);case 17: P2=0xfe;san();break;delay(1);case 18: P2=0xfe;yi();break;delay(1);case 19: P2=0xfd;yi();break;delay(1);case 20: P2=0xfb;yi();break;delay(1);case 21: P2=
14、0xf7;yi();break;delay(1);case 22: P2=0xef;yi();break;delay(1);case 23: P2=0xf7;yi();break;delay(1);case 24: P2=0xfb;yi();break;delay(1);case 25: P2=0xfd;yi();break;delay(1);case 26: P2=0xfe;yi();break;delay(1);case 27: P2=0xfe;si();break;delay(1);case 28: P2=0xfd;si();break;delay(1);case 29: P2=0xfb
15、;si();break;delay(1);case 30: P2=0xf7;si();break;delay(1);case 31: P2=0xef;si();break;delay(1);case 32: P2=0xf7;si();break;delay(1);case 33: P2=0xfb;si();break;delay(1);case 34: P2=0xfd;si();break;delay(1);case 35: P2=0xfe;si();break;delay(1);void xin()P0=0xff;d1=1;d2=0;P1=0x03;delay(8);P1=0x05;dela
16、y(8);P1=0x09;delay(8);P1=0x0a;delay(8);P1=0x0b;delay(8);P1=0x0f;delay(8);P1=0x02;delay(8);P1=0x01;delay(8);P1=0x00;delay(8);P1=0x06;delay(8);P1=0x07;delay(8);P1=0x0f;delay(8);d1=0;d2=1;P1=0x00;delay(8);P1=0x40;delay(8);P1=0x90;delay(8);P1=0xa0;delay(8);P1=0xe0;delay(8);q1=0;delay(8);q2=0;delay(8);q3
17、=0;delay(8);P1=0x10;delay(8);P1=0x20;delay(8);P1=0x30;delay(8);P1=0xb0;delay(8);P1=0xc0;delay(8);P1=0xd0;delay(8);P1=0x80;delay(8);void shanxin()switch(t)case 0: P2=0xfe;xin();break;delay(1);case 1: P2=0xfd;xin();break;delay(1);case 2: P2=0xfb;xin();break;delay(1);case 3: P2=0xf7;xin();break;delay(1
18、);case 4: P2=0xef;xin();break;delay(1);case 5: P2=0xf7;xin();break;delay(1);case 6: P2=0xfb;xin();break;delay(1);case 7: P2=0xfd;xin();break;delay(1);void qierjiu()switch(t)case 0: P0=0xff;P2=0xfe;qi();break;delay(1);case 1: P2=0xfd;qi();break;delay(1);case 2: P2=0xfb;qi();break;delay(1);case 3: P2=
19、0xf7;qi();break;delay(1);case 4: P2=0xef;qi();break;delay(1);case 5: P2=0xf7;qi();break;delay(1);case 6: P2=0xfb;qi();break;delay(1);case 7: P2=0xfd;qi();break;delay(1);case 8: P2=0xfe;qi();break;delay(1);case 9: P2=0xfe;er();break;delay(1);case 10: P2=0xfd;er();break;delay(1);case 11: P2=0xfb;er();
20、break;delay(1);case 12: P2=0xf7;er();break;delay(1);case 13: P2=0xef;er();break;delay(1);case 14: P2=0xf7;er();break;delay(1);case 15: P2=0xfb;er();break;delay(1);case 16: P2=0xfd;er();break;delay(1);case 17: P2=0xfe;er();break;delay(1);case 18: P2=0xfe;jiu();break;delay(1);case 19: P2=0xfd;jiu();br
21、eak;delay(1);case 20: P2=0xfb;jiu();break;delay(1);case 21: P2=0xf7;jiu();break;delay(1);case 22: P2=0xef;jiu();break;delay(1);case 23: P2=0xf7;jiu();break;delay(1);case 24: P2=0xfb;jiu();break;delay(1);case 25: P2=0xfd;jiu();break;delay(1);case 26: P2=0xfe;jiu();break;delay(1);void ii()P0=0xff;d1=1
22、;d2=0;P1=0x04;delay(8);d1=0;d2=1;P1=0x04;delay(8);P1=0x54;delay(8);P1=0x94;delay(8);P1=0xa4;delay(8);P1=0xb4;delay(8);P1=0xc4;delay(8);P1=0xd4;delay(8);P1=0xe4;delay(8);P1=0xf4;delay(8);void ll()P0=0xff;d1=1;d2=0;P1=0x50;delay(8);P1=0x51;delay(8);P1=0x52;delay(8);P1=0x53;delay(8);P1=0x5f;delay(8);P1
23、=0x5e;delay(8);d1=0;d2=1;P1=0x5e;delay(8);P1=0x9e;delay(8);P1=0xae;delay(8);void oo()P0=0xff;d1=1;d2=0;P1=0x04;delay(8);P1=0x02;delay(8);P1=0x0a;delay(8);P1=0x0b;delay(8);P1=0x0f;delay(8);d1=0;d2=1;P1=0x10;delay(8);P1=0x40;delay(8);P1=0x90;delay(8);P1=0xa0;delay(8);P1=0xf0;delay(8);q2=0;delay(8);q3=
24、0;delay(8);void vv()P0=0xff;d1=1;d2=0;P1=0x08;delay(8);P1=0x09;delay(8);P1=0x0a;delay(8);P1=0x0b;delay(8);P1=0x0f;delay(8);d1=0;d2=1;P1=0x90;delay(8);P1=0xa0;delay(8);P1=0x40;delay(8);q0=0;delay(8);q1=0;delay(8);q2=0;delay(8);q3=0;delay(8);void ee()P0=0xff;d1=1;d2=0;P1=0x00;delay(8);P1=0x01;delay(8)
25、;P1=0x02;delay(8);P1=0x03;delay(8);P1=0x0f;delay(8);P1=0x0e;delay(8);P1=0x04;delay(8);P1=0x07;delay(8);d1=0;d2=1;P1=0xc0;delay(8);P1=0x30;delay(8);P1=0xf0;delay(8);P1=0x00;delay(8);P1=0x50;delay(8);P1=0x90;delay(8);P1=0xa0;delay(8);void yy()P0=0xff;d1=1;d2=0;P1=0x08;delay(8);P1=0x02;delay(8);P1=0x06
26、;delay(8);P1=0x07;delay(8);d1=0;d2=1;P1=0x07;delay(8);P1=0x97;delay(8);P1=0x87;delay(8);P1=0xe7;delay(8);void uu()P0=0xff;d1=1;d2=0;P1=0x08;delay(8);P1=0x09;delay(8);P1=0x0a;delay(8);P1=0x0b;delay(8);P1=0x0c;delay(8);P1=0x0e;delay(8);d1=0;d2=1;P1=0x00;delay(8);P1=0x10;delay(8);P1=0x20;delay(8);P1=0x
27、30;delay(8);P1=0x40;delay(8);P1=0xa0;delay(8);P1=0x90;delay(8);void iloveyou()switch(t)case 0: P0=0xff;P2=0xfe;ii();break;delay(1);case 1: P2=0xfd;ii();break;delay(1);case 2: P2=0xfb;ii();break;delay(1);case 3: P2=0xf7;ii();break;delay(1);case 4: P2=0xef;ii();break;delay(1);case 5: P2=0xf7;ii();brea
28、k;delay(1);case 6: P2=0xfb;ii();break;delay(1);case 7: P2=0xfd;ii();break;delay(1);case 8: P2=0xfe;ii();break;delay(1);case 9: P2=0xfe;ll();break;delay(1);case 10: P2=0xfd;ll();break;delay(1);case 11: P2=0xfb;ll();break;delay(1);case 12: P2=0xf7;ll();break;delay(1);case 13: P2=0xef;ll();break;delay(
29、1);case 14: P2=0xf7;ll();break;delay(1);case 15: P2=0xfb;ll();break;delay(1);case 16: P2=0xfd;ll();break;delay(1);case 17: P2=0xfe;ll();break;delay(1);case 18: P2=0xfe;oo();break;delay(1);case 19: P2=0xfd;oo();break;delay(1);case 20: P2=0xfb;oo();break;delay(1);case 21: P2=0xf7;oo();break;delay(1);c
30、ase 22: P2=0xef;oo();break;delay(1);case 23: P2=0xf7;oo();break;delay(1);case 24: P2=0xfb;oo();break;delay(1);case 25: P2=0xfd;oo();break;delay(1);case 26: P2=0xfe;oo();break;delay(1);case 27: P2=0xfe;vv();break;delay(1);case 28: P2=0xfd;vv();break;delay(1);case 29: P2=0xfb;vv();break;delay(1);case
31、30: P2=0xf7;vv();break;delay(1);case 31: P2=0xef;vv();break;delay(1);case 32: P2=0xf7;vv();break;delay(1);case 33: P2=0xfb;vv();break;delay(1);case 34: P2=0xfd;vv();break;delay(1);case 35: P2=0xfe;vv();break;delay(1);case 36: P2=0xfe;ee();break;delay(1);case 37: P2=0xfd;ee();break;delay(1);case 38:
32、P2=0xfb;ee();break;delay(1);case 39: P2=0xf7;ee();break;delay(1);case 40: P2=0xef;ee();break;delay(1);case 41: P2=0xf7;ee();break;delay(1);case 42: P2=0xfb;ee();break;delay(1);case 43: P2=0xfd;ee();break;delay(1);case 44: P2=0xfe;ee();break;delay(1);case 45: P2=0xfe;yy();break;delay(1);case 46: P2=0
33、xfd;yy();break;delay(1);case 47: P2=0xfb;yy();break;delay(1);case 48: P2=0xf7;yy();break;delay(1);case 49: P2=0xef;yy();break;delay(1);case 50: P2=0xf7;yy();break;delay(1);case 51: P2=0xfb;yy();break;delay(1);case 52: P2=0xfd;yy();break;delay(1);case 53: P2=0xfe;yy();break;delay(1);case 54: P2=0xfe;
34、oo();break;delay(1);case 55: P2=0xfd;oo();break;delay(1);case 56: P2=0xfb;oo();break;delay(1);case 57: P2=0xf7;oo();break;delay(1);case 58: P2=0xef;oo();break;delay(1);case 59: P2=0xf7;oo();break;delay(1);case 60: P2=0xfb;oo();break;delay(1);case 61: P2=0xfd;oo();break;delay(1);case 62: P2=0xfe;oo()
35、;break;delay(1);case 63: P2=0xfe;uu();break;delay(1);case 64: P2=0xfd;uu();break;delay(1);case 65: P2=0xfb;uu();break;delay(1);case 66: P2=0xf7;uu();break;delay(1);case 67: P2=0xef;uu();break;delay(1);case 68: P2=0xf7;uu();break;delay(1);case 69: P2=0xfb;uu();break;delay(1);case 70: P2=0xfd;uu();bre
36、ak;delay(1);case 71: P2=0xfe;uu();break;delay(1);void shui()switch(t)case 0: P0=0xff;d1=1;d2=0;P1=0x05;P2=0xfe;break;delay(1);case 1: d1=1;d2=0;P1=0x05;P2=0xfd;break;delay(1);case 2: d1=1;d2=0;P1=0x05;P2=0xfb;break;delay(1);case 3: d1=1;d2=0;P1=0x05;P2=0xf7;break;delay(1);case 4: d1=1;d2=0;P1=0x05;P
37、2=0xef;break;delay(1);case 5: d1=1;d2=0;P1=0x05;P2=0xf7;break;delay(1);case 6: d1=1;d2=0;P1=0x05;P2=0xfb;break;delay(1);case 7: d1=1;d2=0;P1=0x05;P2=0xfd;break;delay(1);case 8: d1=1;d2=0;P1=0x05;P2=0xfe;break;delay(1);case 9: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfe;break;delay(1);case 10
38、: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfd;break;delay(1);case 11: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfb;break;delay(1);case 12: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf7;break;delay(1);case 13: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xef;break;delay(1);cas
39、e 14: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf7;break;delay(1);case 15: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfb;break;delay(1);case 16: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfd;break;delay(1);case 17: d1=1;d2=0;P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfe;break;delay(1)
40、;case 18: d1=1;d2=0;P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfe;break;delay(1);case 19: d1=1;d2=0;P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfd;break;delay(1);case 20: d1=1;d2=0;P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfb;break;delay(1);case 21: d1=1;d2=0;P
41、1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf7;break;delay(1);case 22: d1=1;d2=0;P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xef;break;delay(1);case 23: d1=1;d2=0;P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf7;break;delay(1);case 24: d1=1;d2=0;P1=0x09;delay(8);P1=0x
42、03;delay(8);P1=0x05;delay(8);P2=0xfb;break;delay(1);case 25: d1=1;d2=0;P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfd;break;delay(1);case 26: d1=1;d2=0;P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfe;break;delay(1);case 27: d1=1;d2=0;P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;d
43、elay(8);P1=0x05;delay(8);P2=0xfe;break;delay(1);case 28: d1=1;d2=0;P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfd;break;delay(1);case 29: d1=1;d2=0;P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfb;break;delay(1);case 30: d1=1;d2=0;P1=0x0a;delay
44、(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf7;break;delay(1);case 31: d1=1;d2=0;P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xef;break;delay(1);case 32: d1=1;d2=0;P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf7;break;delay(1);ca
45、se 33: d1=1;d2=0;P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfb;break;delay(1);case 34: d1=1;d2=0;P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfd;break;delay(1);case 35: d1=1;d2=0;P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;dela
46、y(8);P2=0xfe;break;delay(1);case 36: d1=1;d2=0;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfe;break;delay(1);case 37: d1=1;d2=0;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfd;break;delay(1);case 38: d1=1;d2=0
47、;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfb;break;delay(1);case 39: d1=1;d2=0;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf7;break;delay(1);case 40: d1=1;d2=0;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;del
48、ay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xef;break;delay(1);case 41: d1=1;d2=0;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf7;break;delay(1);case 42: d1=1;d2=0;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xf
49、b;break;delay(1);case 43: d1=1;d2=0;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfd;break;delay(1);case 44: d1=1;d2=0;P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfe;break;delay(1);case 45: d1=1;d2=0;P1=0x0f;delay(8);P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);P2=0xfe;break;delay(1);case 46: d1=1;d2=0;P1=0x0f;delay(8);P1=0x0b;delay(8);P1=0x0a;delay(8);P1=0x09;delay(8);P1=0x03;delay(8);P1=0x05;delay(8);