求高人帮忙对这个单片机点歌系统代码加注释和解释
#include <reg51.h>#define uint unsigned int
#define uchar unsigned char
#define led RD
#define key_rec T1
sbit BUZZER=P2^4;//发声音口
uchar code T0_H[16]={0xFF,0xFB,0xFB,0xFC,0xFC,0xFC,0xFD,0xFD,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE};
uchar code T0_L[16]={0xF1,0x4,0x90,0xC,0x44,0xAC,0x9,0x34,0x82,0xC8,0x06,0x22,0x56,0x85,0x9A,0xC1};
uchar code music[32]={8,0,8,9,8,0xB,0xA,0,8,0,8,9,8,0xC,0xB,0,8,0,8,0xF,0xD,0xB,0xA,9,0xE,0,0xE,0xD,0xB,0xC,0xB,0x0};
uchar code music_L[32]={2,1,1,4,4,4,4,4,2,1,1,4,4,4,4,4,2,1,1,4,4,4,4,4,2,1,1,4,4,4,4,4};
uchar a,b;
uint second,minute;
long t0count;
void delay_music(uint v)
{
while(v!=0) v--;
}
void delay_music1(uint j)
{
while(j!=0){j--;delay_music(200);}
}
void delay_music2(uint j)
{
while(j!=0){j--;delay_music1(80);}
}
main()
{//uint i;
uchar k,n,m;
delay_music(100);
TMOD=0x11;
TH0=0xfc;
TL0=0x66;
t0count=0;
EA=1;
ET0=0;
TR0=0;
ET1=0;
TR1=0;
while(1)
{
ET1=1;
TR1=1;
for(k=0;k<32;k++)
{
n=music[k];
m=music_L[k];
a=T0_H[n];
b=T0_L[n];
delay_music2(m);
}
}
}
time0() interrupt 1 using 1
{
TH0=0xFC;
TL0=0x66;
t0count=t0count+1;
if (t0count==1000)
{
second++;
if (second==60)
{
minute++;
if (minute==60) minute=0;
second=0;
}
t0count=0;
}
}
time1 () interrupt 3 using 3
{
TH1=a;
TL1=b;
BUZZER=!BUZZER;
}
求高人帮忙 十分感谢~