#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit DQ=P2^4;//temp
sbit RS=P2^6;
sbit RW=P2^5;
sbit EN=P2^7;
uchar code str1[]={" temperature: "};
uchar code str2[]={""};
uchar data disdata[5];
uint tvalue;
uchar tflag;
...
#include <REGX52.H>
sbit speaker=P2^1;
unsigned char timer0h,timer0l,time;
//定义每个音阶的长度的数组 《世上只有妈妈好》
code unsigned char song_mother[]=
{
6,2,3,5,2,1 ,3,2,2,5,2,2, 1,3,2,6,2,1,5,2,1,
6,2,4,3,2,2, 5,2,1, 6,2,1, 5,2,2, 3,2,1 ,2,2,1,1,2,1,
6,1,1,5,2,1, 3,2,1 ,2,2,4, 2,2,3, 3,2,1, 5,2,2,
5,...