本文引用地址:http://www.ex-cimer.com/article/201611/321778.htm//********************************
//時(shí)鐘萬(wàn)年歷+溫度+液晶顯示
//LCD1602+DS1302+DS18B20
//作者:曾憲陽(yáng)
//網(wǎng)址:http://hi.baidu.com/zxymcu
//********************************
#include
#include"zxysrc/ds1302.h"
#include"zxysrc/lcd1602.h"
#include"zxysrc/delay.h"
#include"zxysrc/DS18B20.H"
voidDisplay(void)
{
ReadDs1302All();
ReadTemp();
Wr1602Cmd(0x80);
Wr1602Dat(0+shi/16);
Wr1602Dat(0+shi);
Wr1602Dat(:);
Wr1602Dat(0+fen/16);
Wr1602Dat(0+fen);
Wr1602Dat(:);
Wr1602Dat(0+miao/16);
Wr1602Dat(0+miao);
Wr1602Dat();
Wr1602Dat(T);
Wr1602Dat(:);
Wr1602Dat(0+DisBufT[1]);
Wr1602Dat(0+DisBufT[2]);
Wr1602Dat(.);
Wr1602Dat(0+DisBufT[3]);
Wr1602Dat(0+DisBufT[4]);
Wr1602Cmd(0xc0);
Wr1602Dat(0+nian/16);
Wr1602Dat(0+nian);
Wr1602Dat(-);
Wr1602Dat(0+yue/16);
Wr1602Dat(0+yue);
Wr1602Dat(-);
Wr1602Dat(0+ri/16);
Wr1602Dat(0+ri);
Wr1602Dat();
Wr1602Dat(W);
Wr1602Dat(e);
Wr1602Dat(e);
Wr1602Dat(k);
Wr1602Dat(:);
Wr1602Dat(0+week);
}
voidmain()
{
Set_1302();
Init1602();
Wr1602Cmd(0x80);
Wr1602Dat(0);
while(1)
{
Display();
}
}
評(píng)論