首页 51单片机数码管电子时钟C程序

51单片机数码管电子时钟C程序

举报
开通vip

51单片机数码管电子时钟C程序51单片机数码管电子时钟C程序 //**单片机stc89c52~8位共单单管 数12M晶振**// //*******P0位单~P2段单*******// #include "reg52.h" #define uchar unsigned char #define uint unsigned int uchar code tab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f, 0x40,0xff}; uchar n; uchar hh,mm,ss...

51单片机数码管电子时钟C程序
51单片机数码管电子时钟C程序 //**单片机stc89c52~8位共单单管 数12M晶振**// //*******P0位单~P2段单*******// #include "reg52.h" #define uchar unsigned char #define uint unsigned int uchar code tab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f, 0x40,0xff}; uchar n; uchar hh,mm,ss; uchar nhh,nmm,nss; uint year; uchar day,mon,week; uchar hhs,hhg,mms,mmg,sss,ssg; uchar days,dayg,mons,mong; uchar nhhs,nhhg,nmms,nmmg,nsss,nssg; uchar set1=1,set2=1; sbit dula=P3^3; sbit fm=P3^2; sbit k1=P3^4; sbit k2=P3^5; sbit k3=P3^6; sbit k4=P3^7; uchar table1[]={31,31,29,31,30,31,30,31,31,30,31,30,31}; //单年 uchar table2[]={31,31,28,31,30,31,30,31,31,30,31,30,31}; //非单年 void jishi(); void baoshi(); void alarm(); void set_time(); void set_alarm(); void set_mdw(); void key_change(); void key_set(); void delay(int m) //延单程序~延单m*0.5ms { uint i; uint j; for (i=0;i
本文档为【51单片机数码管电子时钟C程序】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_036899
暂无简介~
格式:doc
大小:32KB
软件:Word
页数:14
分类:生活休闲
上传时间:2017-10-22
浏览量:62