|
附上源程序
0.png (70.47 KB, 下載次數(shù): 121)
下載附件
2017-1-8 17:47 上傳
完整代碼下載:
dingshiqi.rar
(45.98 KB, 下載次數(shù): 41)
2017-1-6 20:11 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
主程序預(yù)覽:
- /***************************************************************************/
- #include <STC89C5xRC.H>
- #include"config.h"
- #include"display.h"
- #include"time.h"
- #include"keymark.h"
- #include"Port.h"
- #include "intrins.h"
- /***************************************************************************/
- /**********************函數(shù)聲明*********************************/
- /*********************************************************************/
- void MCUINIT() //初始化函數(shù)
- {
- _nop_();_nop_();
- P1=0x00;
- P2=0xf9;
- P3=0xdf;
- P1=0xff;
- {
- TMOD=0x01;//設(shè)置定時(shí)器0為工作方式1(0000 0001)
- TH0=(65536-50000)/256;//裝初值50ms一次中斷
- TL0=(65536-50000)%256;
- EA=1; //開(kāi)總中斷
- ET0=1; //開(kāi)定時(shí)器0中斷
- TR0=1; //啟動(dòng)定時(shí)器0
- Num=0;
- Hour=9;
- Minite=0;
- shuchu=0; //繼電器不動(dòng)作,常閉點(diǎn)有輸出
- timeclose=0;
- jishitemp=1;
- }
- /*********************************************************************/
- _nop_();_nop_();
- _nop_();_nop_();
- }
- /****************************主函數(shù)*****************************************/
- void main()
- {
- MCUINIT();
- HC595Init();
- timedis_code();
- while(1)
- {
- key_scan(); //按鍵掃描
- _nop_();_nop_();
- while(!timeclose)
- {
- jishi();
- if (! jishitemp) //在time.c中
- {
- shuchu= 1; //P3.5置1,沒(méi)電輸出
- Display00(); //在Display.c 中
- TR0=0; //關(guān)閉定時(shí)器0
- timeclose=1; //標(biāo)記時(shí)間關(guān)
- }
- else shuchu= 0; //P3.5置0,有電輸出
- _nop_();_nop_();
- key_scan(); //按鍵掃描
- _nop_();_nop_();
- }
- _nop_();_nop_();
- }
- }
- /*********************************************************************/
復(fù)制代碼
|
評(píng)分
-
查看全部評(píng)分
|