/********************************************************************************************************
郑州大学西亚斯国际学院电子系
自动化1班 薛迪杰
制作日期:2009-8-15
********************************************************************************************************/
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit rs=P2^5; //模式位,1输入数据、0输入指令
sbit rw=P2^6; //读写位,1写、0读
sbit lcden=P2^4; //使能位
sbit dscs=P3^5; //ds12c887选通位
sbit dsas=P3^4; //ds12c887地址锁存位
sbit dsrw=P3^3; //ds12c887读写选择位
sbit dsds=P3^1; //ds12c887数据锁存位
sbit dsirq=P3^2; //中断位
sbit buzzer=P3^6; //蜂鸣器
sbit dq=P3^7; //DS18B20
sbit key1=P2^0; //按键1
sbit key2=P2^1; //按键2
sbit key3=P2^2; //按键3
sbit key4=P2^3; //按键4
uchar address,shi,ge,sec,min,hour,day,date,month,year,sec_temp,min_temp,hour_temp,day_temp,date_temp,month_temp,year_temp,secl,menu,alarm;
uchar flag1,flag_temper,flag2,flag3,flag4;
uchar code tab[11][64]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x06,0x30,
0x0C,0x18,0x18,0x0C,0x18,0x0C,0x18,0x04,0x30,0x06,0x30,0x06,0x30,0x06,0x30,0x06,
0x30,0x06,0x30,0x06,0x30,0x06,0x30,0x06,0x30,0x06,0x18,0x04,0x18,0x0C,0x18,0x0C,
0x0C,0x18,0x06,0x30,0x03,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"0",0
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x80,
0x1F,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x03,0xC0,0x1F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"1",1
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x08,0x38,
0x10,0x18,0x20,0x0C,0x20,0x0C,0x30,0x0C,0x30,0x0C,0x00,0x0C,0x00,0x18,0x00,0x10,
0x00,0x20,0x00,0x40,0x00,0x80,0x01,0x00,0x02,0x00,0x04,0x04,0x08,0x04,0x10,0x04,
0x20,0x0C,0x3F,0xF8,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"2",2
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x18,0x70,
0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x00,0x18,0x00,0x30,0x00,0x60,0x03,0xC0,
0x00,0x70,0x00,0x18,0x00,0x08,0x00,0x0C,0x00,0x0C,0x30,0x0C,0x30,0x0C,0x30,0x08,
0x30,0x18,0x18,0x30,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"3",3
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x70,
0x00,0x70,0x00,0xF0,0x01,0x70,0x01,0x70,0x02,0x70,0x06,0x70,0x04,0x70,0x08,0x70,
0x08,0x70,0x10,0x70,0x20,0x70,0x20,0x70,0x7F,0xFE,0x00,0x70,0x00,0x70,0x00,0x70,
0x00,0x70,0x00,0x70,0x00,0x70,0x03,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"4",4
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFC,0x0F,0xFC,
0x08,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x10,0x00,0x13,0xE0,0x14,0x30,0x18,0x18,
0x10,0x08,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x30,0x0C,0x30,0x0C,0x20,0x18,
0x20,0x18,0x10,0x30,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"5",5
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x03,0x08,
0x04,0x0C,0x08,0x0C,0x18,0x00,0x18,0x00,0x10,0x00,0x30,0x00,0x31,0xF0,0x36,0x18,
0x3C,0x0C,0x38,0x06,0x30,0x06,0x30,0x06,0x30,0x06,0x30,0x06,0x18,0x06,0x18,0x04,
0x0C,0x0C,0x06,0x18,0x03,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"6",6
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x1F,0xFC,
0x38,0x08,0x30,0x10,0x20,0x10,0x20,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,
0x00,0x80,0x00,0x80,0x01,0x00,0x01,0x00,0x01,0x00,0x03,0x00,0x03,0x00,0x03,0x00,
0x03,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"7",7
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x0C,0x30,
0x18,0x18,0x30,0x0C,0x30,0x0C,0x30,0x0C,0x38,0x0C,0x1C,0x18,0x0E,0x10,0x07,0xE0,
0x0D,0xE0,0x18,0x70,0x30,0x38,0x60,0x1C,0x60,0x0C,0x60,0x0C,0x60,0x0C,0x60,0x0C,
0x30,0x18,0x18,0x30,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"8",8
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x18,0x20,
0x30,0x10,0x30,0x18,0x60,0x08,0x60,0x0C,0x60,0x0C,0x60,0x0C,0x60,0x0C,0x60,0x1C,
0x30,0x3C,0x18,0x6C,0x0F,0x8C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x18,0x30,0x30,
0x30,0x60,0x30,0xC0,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"9",9
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0x80,0x03,0xC0,0x03,0xC0,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,0xC0,0x03,0xC0,0x01,0x80,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,},//":",10
};
uchar code img1[64][16]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFB,0x00,0x00,
0x00,0x01,0x81,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xE3,0x00,0x00,
0x00,0x0D,0x81,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x87,0x3F,0x00,
0x00,0x0F,0xED,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x1E,0xFF,0x00,
0x00,0x0D,0x8D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x3D,0xF3,0x80,
0x00,0x19,0x8D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xEE,0x77,0x83,0x80,
0x00,0x1F,0xFD,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFD,0xEE,0x0F,0x00,
0x00,0x01,0x8D,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFD,0xFC,0x7E,0x00,
0x00,0x0F,0xFD,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x00,0x73,0xFC,0x00,
0x00,0x0D,0xBD,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x0F,0xE0,0x00,
0x00,0x0D,0xB1,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x0F,0x00,0x00,
0x00,0x0D,0xF1,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x03,0x80,0x00,
0x00,0x0D,0xE7,0x80,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,
0x00,0x01,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0xC0,0x00,
0x00,0x00,0x00,0x00,0x03,0x0C,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0xE0,0x00,
0x00,0x03,0x60,0x00,0x1F,0xFF,0x80,0x00,0x00,0x06,0xE0,0x00,0x00,0x00,0x60,0x00,
0x00,0x03,0x60,0x00,0x03,0x0C,0x00,0x00,0x00,0x0E,0xFF,0x00,0x00,0x00,0x60,0x00,
0x00,0x06,0x7F,0x80,0x0C,0x18,0x00,0x00,0x00,0x0C,0x1F,0x3F,0xE0,0x00,0x70,0x00,
0x00,0x06,0xF0,0x00,0x1F,0x8C,0x00,0x00,0x00,0x0C,0x00,0x3F,0xFF,0x00,0x70,0x00,
0x00,0x0E,0xF0,0x00,0x19,0xFF,0x80,0x00,0x00,0x0C,0x00,0x01,0xFF,0x00,0x30,0x00,
0x00,0x1F,0xBE,0x00,0x1F,0xB3,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x70,0x00,
0x00,0x07,0x30,0x00,0x18,0x1E,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x70,0x00,
0x00,0x06,0x30,0x00,0x1F,0xFF,0x80,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x60,0x00,
0x00,0x06,0x30,0x00,0x19,0x8C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x60,0x00,
0x00,0x06,0x3F,0x00,0x19,0xBF,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0xE0,0x00,
0x00,0x06,0x30,0x00,0x1F,0x8C,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0xC0,0x00,
0x00,0x06,0x30,0x00,0x18,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x0