ImageVerifierCode 换一换
格式:DOCX , 页数:12 ,大小:53.92KB ,
资源ID:8576190      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/8576190.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(基于51数码管显示的万年历仿真+程序完整.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

基于51数码管显示的万年历仿真+程序完整.docx

1、基于51数码管显示的万年历仿真+程序完整基于数码管显示的万年历(proteus仿真+C程序)Proteus仿真图C语言程序/*TITLE: 万年历设计FUNCTION: 显示:年-月-日-星期-时-分-秒WRITER: LINLIANHUOTIME: 2014-07-24REMARK: 译码扫描时间不能过长,否则无法实现调整*/#include#define uint unsigned int#define uchar unsigned char/*码表*/uchar code smg_table=0xBF,0x86,0xDB,0xCF,0xE6, 0xED,0xFD,0xA7,0xFF,0x

2、EF,0xC0;uchar code months_days=31,28,31,30,31,30,31,31,30,31,30,31;uchar code transcode=0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6, 0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed, 0xee,0xef,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd;uchar buffer22=0; /*数据定义*/uchar add_sub;uchar key_detection=0;uchar count=0;typedef struct uchar yea

3、r2; uchar month; uchar day; uchar week;date;typedef struct uchar hour; uchar minute; uchar second;moment;date today=14,20,7,25,5;moment now=16,52,45;/*延时子程序*/void delay() uchar i,j; for(i=0;i=8;i+) for(j=0;j40;j+);/*数码管显示子程序*/void smg_display() uchar i; buffer0=now.second%10; buffer1=now.second/10;

4、buffer2=10; buffer3=now.minute%10; buffer4=now.minute/10; buffer5=10; buffer6=now.hour%10; buffer7=now.hour/10; buffer8=today.week%10; buffer9=today.week/10; buffer10=10; buffer11=today.day%10; buffer12=today.day/10; buffer13=10; buffer14=today.month%10; buffer15=today.month/10; buffer16=10; buffer1

5、7=today.year0%10; buffer18=today.year0/10; buffer19=today.year1%10; buffer20=today.year1/10; buffer21=10; for(i=0;i=60) now.second=0; now.minute+; if(now.minute=60) now.minute=0; now.hour+; if(now.hour=24) now.hour=0; today.day+; today.week+; if(today.week=8) today.week=1; l=leap_year(today.year1,to

6、day.year0); if(l=1)&(today.month=2) if(today.day=30) today.day=1; today.month+; else if(today.day=months_daystoday.month-1+1) today.day=1; today.month+; if(today.month=12) today.month=1; today.year0=today.year0+1; if(today.year0=100) today.year0=0; today.year1=today.year1+1; if(today.year1=100) toda

7、y.year1=0; smg_display();/*INT0中断服务子程序*/void int0_int() interrupt 0 using 1 uchar k; switch(add_sub) case 0x80:switch(key_detection) case 0xfe: now.second+; if(now.second=60) now.second=0; smg_display(); break; case 0xfd: now.minute+; if(now.minute=60) now.minute=0; smg_display(); break; case 0xfb:

8、now.hour+; if(now.hour=24) now.hour=0; smg_display(); break; case 0xf7: today.week+; if(today.week=8) today.week=1; smg_display(); break; case 0xef: today.day+; k=leap_year(today.year1,today.year0); if(k=1)&(today.month=2) if(today.day=30) today.day=1; else if(today.day=months_daystoday.month-1) tod

9、ay.day=1; smg_display(); break; case 0xdf: today.month+; if(today.month=13) today.month=1; smg_display(); break; case 0xbf: today.year0=today.year0+1; if(today.year0=100) today.year0=0; today.year1=today.year1+1; if(today.year1=100) today.year1=0; smg_display(); break; default:EA=1;EX0=0;TR0=1;break

10、; break; case 0x00:switch(key_detection) case 0x7e: /now.second+; if(now.second0) now.second-; else now.second=59; smg_display(); break; case 0x7d: /now.minute+; if(now.minute0) now.minute-; else now.minute=59; smg_display(); break; case 0x7b: /now.hour+; if(now.hour0) now.hour-; else now.hour=23; s

11、mg_display(); break; case 0x77: /today.week+; if(today.week1) today.week-; else today.week=1; smg_display(); break; case 0x6f: /today.day+; k=leap_year(today.year1,today.year0); if(k=1)&(today.month=2) if(today.day1) today.day-; else today.day=29; else if(today.day1) today.day-; else today.day=month

12、s_daystoday.month-1; smg_display(); break; case 0x5f: /today.month+; if(today.month1) today.month-; else today.month=12; smg_display(); break; case 0x3f: /today.year0=today.year0+1; if(today.year00) today.year0=today.year0-1; else today.year0=99; today.year1=today.year1-1; smg_display(); break; default:EA=1;EX0=0;TR0=1;break; break;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1