#include<reg52.h>#include<absacc.h>#include<math.h>#include<intrins.h>#defineucharunsignedchar#defineuintunsignedintucharcode*song;ucharcode*song_name;ucharcode*song_lrc;uchartable[10]={'0','1','2','3','4','5','6','7','8','9'};ucharcodetab[]={0xf8,0x94,0xf9,0x5c,0xfa,0x1a,0xfa,0x6a,0xfb,0x00,0xfb,0x8c,0xfc,0x0e,0xfc,0x4a,0xfc,0xae,0xfd,0x08,0xfd,0x30,0xfd,0x80,0xfd,0xc6,0xfe,0x02,0xfe,0x2a,0xfe,0x5c,0xfe,0x84,0xfe,0x98,0xfe,0xc0,0xfe,0xe8,0xfe,0x06,0xff};//两只老虎ucharcodesong1[]={0x44,0x54,0x64,0x44,0x44,0x54,0x64,0x44,0x64,0x74,0x88,0x64,0x74,0x88,0x82,0x92,0x82,0x72,0x64,0x44,0x82,0x92,0x82,0x72,0x64,0x44,0x54,0x14,0x48,0x54,0x14,0x48,0xff};//新年快乐ucharcodesong2[]={0x42,0x42,0x44,0x14,0x02,0x62,0x62,0x64,0x44,0x04,0x42,0x62,0x84,0x84,0x02,0x72,0x62,0x54,0x04,0x52,0x62,0x74,0x74,0x02,0x62,0x52,0x64,0x44,0x04,0x42,0x62,0x54,0x14,0x02,0x32,0x52,0x44,0x04,0xff};//生日快乐ucharcodesong3[]={0xC4,0x12,0x32,0x44,0x42,0x52,0x52,0x44,0x32,0x32,0x12,0x14,0x12,0x12,0x32,0x42,0x54,0x44,0x4F,0xC4,0x12,0x32,0x44,0x42,0x72,0x58,0x42,0x32,0x34,0x14,0x12,0x32,0x34,0x12,0x1F,0xff};//星星索ucharcodesong4[]={0x82,0x01,0x81,0x94,0x84,0xB4,0x04,0x04,0x82,0x01,0x81,0x94,0x84,0xC4,0xB4,0x04,0x82,0x01,0x81,0xF4,0xD4,0xB4,0xA4,0x94,0x04,0xE2,0x01,0xE1,0xD4,0xB4,0xC4,0xB4,0x04,0xff};//梁祝ucharcodesong5[]={0xA2,0xB2,0xD2,0xB2,0xA4,0xB2,0xD2,0xB2,0xA2,0x82,0x72,0x88,0x72,0x82,0xA2,0x82,0x72,0x62,0x42,0x62,0x38,0x38,0xA4,0x02,0xB2,0xA4,0x84,0x72,0x82,0x72,0x62,0x72,0x84,0x72,0x64,0x62,0x12,0x34,0x02,0x42,0x38,0x38,0x44,0x02,0x32,0x44,0x64,0x72,0x82,0x72,0x62,0x72,0x84,0xA2,0x72,0xff};//同一首歌ucharcodesong6[]={0x42,0x82,0x82,0x82,0x86,0x72,0x63,0x71,0x62,0x52,0x48,0xB2,0xB2,0xB2,0xB2,0xB6,0xA2,0x83,0xA1,0xA2,0x92,0x88,0x82,0xB2,0xB2,0xA2,0x86,0x72,0x63,0x71,0x62,0x52,0x44,0x12,0x02,0x12,0x62,0x62,0x52,0x46,0x82,0x73,0x61,0x52,0x32,0x48,0x00,0xff};//记事本ucharcodesong7[]={0x84,0x82,0x82,0x82,0xB2,0xB2,0x82,0xC2,0xC3,0x82,0x84,0xB2,0xA2,0xA2,0x93,0x04,0x94,0x92,0x82,0x82,0x63,0x62,0x62,0x52,0x52,0x42,0x44,0x04,0x62,0x52,0x52,0x42,0x84,0x04,0x92,0x82,0x94,0x82,0x63,0x04,0x84,0x82,0x82,0x82,0xB2,0xB2,0x82,0xC2,0xC3,0x83,0x04,0x84,0xB2,0xA2,0xA2,0x93,0x94,0x82,0x92,0x82,0x63,0x04,0x52,0x62,0x52,0x62,0x44,0x04,0xff};//绿岛小夜曲ucharcodesong8[]={0xA2,0xB2,0xD2,0xB2,0xA4,0xB2,0xD2,0xB2,0xA2,0x82,0x72,0x88,0x72,0x82,0xA2,0x82,0x72,0x62,0x42,0x62,0x38,0x38,0xA4,0x02,0xB2,0xA4,0x84,0x72,0x82,0x72,0x62,0x72,0x84,0x72,0x64,0x62,0x12,0x34,0x02,0x42,0x38,0x38,0x44,0x02,0x32,0x44,0x64,0x72,0x82,0x72,0x62,0x72,0x84,0xA2,0x72,0xff};//让我们荡起双桨ucharcodesong9[]={0x06,0x08,0x08,0x08,0x09,0x08,0x0A,0x18,0x0C,0x08,0x0A,0x08,0x08,0x08,0x09,0x10,0x06,0x20,0x00,0x08,0x08,0x08,0x09,0x08,0x0A,0x08,0x0C,0x18,0x00,0x01,0x0C,0x08,0x0D,0x10,0x09,0x10,0x0A,0x30,0x00,0x01,0x0A,0x08,0x0C,0x08,0x0D,0x20,0x0C,0x18,0x0D,0x08,0x0F,0x08,0x0E,0x04,0x0D,0x04,0x0C,0x08,0x0D,0x08,0x0A,0x10,0x00,0x04,0x08,0x08,0x09,0x08,0x0A,0x18,0x0C,0x08,0x08,0x10,0x06,0x10,0x08,0x08,0x09,0x08,0x0A,0x08,0x0D,0x08,0x0C,0x30,0x00,0x10,0x0A,0x20,0x0D,0x18,0x00,0x01,0x0D,0x08,0x0C,0x08,0x0B,0x08,0x0A,0x10,0x00,0x01,0x09,0x20,0x0A,0x18,0x0C,0x08,0x06,0x08,0x08,0x08,0x09,0x10,0x00,0x10,0x08,0x08,0x09,0x08,0x0A,0x10,0x0C,0x0B,0x00,0x01,0x0C,0x04,0x0D,0x10,0x0F,0x10,0x0E,0x08,0x0D,0x08,0x0C,0x08,0x0A,0x08,0x0D,0x40,0x00,0x01,0xff};ucharcodesong_name10[18]={0xc7,0xfa,0xc4,0xbf,0xca,0xae,0xa1,0xc3,0xc0,0xbc,0xbb,0xa8,0xb2,0xdd,0xff};//兰花草ucharcodesong10[]={0x42,0x82,0x82,0x82,0x86,0x72,0x63,0x71,0x62,0x52,0x48,0xB2,0xB2,0xB2,0xB2,0xB6,0xA2,0x83,0xA1,0xA2,0x92,0x88,0x82,0xB2,0xB2,0xA2,0x86,0x72,0x63,0x71,0x62,0x52,0x44,0x12,0x02,0x12,0x62,0x62,0x52,0x46,0x82,0x73,0x61,0x52,0x32,0x48,0x00,0xff};unsignedcharcodeinit[]={0xB0,0xB4,0xBC,0xFC,0xD1,0xA1,0xD4,0xF1,0xB8,0xE8,0xC7,0xFA,0x20,0x20,0x20,0x20,0xff};//unsignedcharcodeqingling[]={0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xff};uchardataflag;uchardatastl0;uchardatasth0;uchardatal;uchardatak;uchardatakey;uchardatat;uchardatan;ucharKey_Value=0xff;unsignedcharbdatakey;unsignedcharbdatastatus;ucharCOUNT_1=0,count=0,yimiao=0,j,i;sbitSing=P2^7;/*P3口接蜂鸣器,输出方波*/sbitE=P2^2;sbitRW=P2^1;sbitRS=P2^0;voiddelay_song();/*延时128ms*/voiddelay(inti);/*延时*/voidKeyScan();/*键盘扫描函数*/ucharzz;voiddelay_song(void)/*延时128ms*/{uintcount111=140;unsignedinti,j;for(i=0;i<count111;i++)for(j=0;j<120;j++);}voiddelay(inti)/*延时*/{intj,k;for(j=0;j<i;j++){k=0x0f;while(k--);}}voidDelay_Ms(uintx)//1ms{uintg,k;for(g=0;g<x;g++)for(k=0;k<=120;k++);}voidDelay_xMs(uintx)//1ms{unsignedinti,j;for(i=0;i<x;i++){for(j=0;j<3;j++);}}voiddelay_5us(){_nop_();_nop_();_nop_();_nop_();_nop_();}bitBusy(void){bitbusy_flag=0;RS=0;RW=1;E=1;delay_5us();busy_flag=(bit)(P0&0x80);E=0;returnbusy_flag;}voidwcmd(uchardel){while(Busy());RS=0;RW=0;E=0;delay_5us();P0=del;delay_5us();E=1;delay_5us();E=0;}voidwdata(uchardel){while(Busy());RS=1;RW=0;E=0;delay_5us();P0=del;delay_5us();E