单片机程序 万年历

上传人:子 文档编号:42768251 上传时间:2018-06-03 格式:DOC 页数:6 大小:363KB
返回 下载 相关 举报
单片机程序 万年历_第1页
第1页 / 共6页
单片机程序 万年历_第2页
第2页 / 共6页
单片机程序 万年历_第3页
第3页 / 共6页
单片机程序 万年历_第4页
第4页 / 共6页
单片机程序 万年历_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《单片机程序 万年历》由会员分享,可在线阅读,更多相关《单片机程序 万年历(6页珍藏版)》请在金锄头文库上搜索。

1、 万年历万年历系统功能:万年历,可以显示年月日时间。选用芯片:80C51 单片机。电路框图:程序代码(C 语言):#include #include #include #define lcdwritecmd XBYTE0xFC00 #define ledwritedat XBYTE0xFE00 sbit SCL=P10 ; sbit SDA=P11 ; char tab2; unsigned char year,mon,day,hour,min,sec,state,hudsec; /=延时函数=void delay(unsigned char n) unsigned char i,j;for(

2、i=0;i4) /= /=显示年月日时分秒的函数=void display() char ch;PCF8583_read();tab0=2;tab1=0;displaystring(0x83,2,year=(day6)+0x0E;datachang(year);displaystring(0x85,2,ch=-;writecmd(0x87);writedata(ch);mon=mondatachang(mon);displaystring(0x88,2,day=daydatachang(day);displaystring(0x8b,2, ch=-;writecmd(0x8a);writeda

3、ta(ch);datachang(hour);displaystring(0x80+0x44,2, ch=:;writecmd(0x80+0x46);writedata(ch);datachang(sec);displaystring(0x80+0x4A,2,ch=:;writecmd(0x80+0x49);writedata(ch);datachang(min);displaystring(0x80+0x47,2, /= /=初始化函数=void init() writecmd(0x38);writecmd(0x0c);writecmd(0x06);writecmd(0x80);PCF8583_write(0x00,0x00);delay(200); /= /=主函数=void main() init(); while(1)display(); /=

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号