Y_CODE[Display_Digit[1]])|0X80;РP2=0XEF;Delay(t);P2=0XFF;РP0=DSY_CODE[Display_Digit[2]];РP2=0XF7;Delay(t);P2=0XFF;РP0=DSY_CODE[Display_Digit[3]];РP2=0XFB;Delay(t);P2=0XFF;Рif(ng)Р{P0=0X40;P2=np;Delay(t);P2=0XFF;}Р}Р}Р/**********定时器0中断,控制报警声音********/ Рvoid T0_INT()interrupt 1Р{Р TH0=-1000/256;Р TL0=-1000%256;Р BEEP=!BEEP;Р if(++Time0_Count==400)Р {Р Time0_Count=0;Р if(HI_Alarm)HI_LED=~HI_LED;Р else HI_LED=1;Р if(LO_Alarm)LO_LED=~LO_LED;Р else LO_LED=1;Р }Р}Рvoid main()Р{Р IE=0X82;Р TMOD=0X01; //方式1计数Р TH0=-1000/256;Р TL0=-1000%256;Р TR0=0;Р HI_LED=1;Р LO_LED=1;Р Set_Alarm_Temp_Value();Р Read_Temperature();Р Delay(50000); Delay(50000);Р while(1)Р {Р Read_Temperature();Р if(DS18B20_IS_OK)Р {Р if(HI_Alarm==1||LO_Alarm==1)TR0=1;Р else TR0=0;Р Display_Temperature(); Р }Р else{P0=P2=0X00;} Р }Р}