#include <AT89X52.h> #define uint unsigned int#define uchar unsigned char //宏定义#define SET P3_1 //定义调整键#define DEC P3_2 //定义减少键#define ADD P3_3 //定义增加键#define BEEP P3_6 //定义蜂鸣器#define ALAM P1_2 //定义灯光报警#define DQ P3_7 //定义DS18B20总线I/O bit shanshuo_st; //闪烁间隔标志bit beep_st; //蜂鸣器间隔标志sbit DIAN = P0^5; //小数点uchar x=0; //计数器signed char m; //温度值全局变量uchar n; //温度值全局变量uchar set_st=0; //状态标志signed char shangxian=38; //上限报警温度,默认值为38signed char xiaxian=5; //下限报警温度,默认值为38//uchar code LEDData[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0xff};uchar code LEDData[]={0x5F,0x44,0x9D,0xD5,0xC6,0xD3,0xDB,0x47,0xDF,0xD7,0xCF,0xDA,0x9B,0xDC,0x9B,0x8B};// |