********************************时钟万年历+温度+液晶显示LCD1602+DS1302+DS18B20作者:曾宪阳网址:http:hibaiducomzxym
//********************************
//时钟万年历+温度+液晶显示
//LCD1602+DS1302+DS18B20
//作者:曾宪阳
//网址: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();
}
}
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/fangan/dianlu/258190.html