main()
{ unsigned char i;
BEEP=0;
Init_Timer0();
Ds1302_Init();
Init_DS18B20();
Init_ST7920(); //初始化
IRcvStr(0xae,80,Alarm,4); //從24c02讀出數據
LCD_PutGraphic(pic0);
for(i=0;i<10;i++)
DelayMs(200);
CGRAM(0);
Interface=MainInterface;//默認界面=主界面
while(1)
{
KeyValue=KeyScan();
if(KeyValue!=0)//如果有鍵按下
{ BEEP=1;
Keyprocessing(KeyValue); //鍵值處理
LCD_PutGraphic(pic0);
ClrScreen();
DelayMs(50);
BEEP=0;
}
Ds1302_Read_Time(); //讀取時鐘
ClockAlarm(); //時鐘報警
temper=ReadTemperature();
temperature=(float)temper*0.0625;//讀取溫度
interface_display(Interface);//顯示界面
}
} |