- 1、本文档共14页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
数码管电子钟(可调时)程序(Digital tube electronic clock (adjustable time) program)
数码管电子钟(可调时)程序(Digital tube electronic clock (adjustable time) program)
* project requirements: K1 key is to adjust the selection key, according to a second, then a transfer points, then a transfer, then a normal travel time.
K2, K3 key is to adjust the + - key
Each time the adjustment of the corresponding key position flashing * /
/***********************************************************
Experiment Name: electronic clock (can be adjusted)
Author: Zhang Wei
Class: 11 class electric inspirational class
Date: 2013-9-30
Yibin University Yu Ming studio all rights reserved.
***********************************************************/
#includereg51.h
#includeintrins.h
#define uint unsigned int
#define uchar unsigned char
#define M 24
Sbit k1=P3^0;
Sbit k2=P3^1;
Sbit k3=P3^2;
Uchar hour=9, min=43, sec=0, buf[8], k=0, key=0, kk=0, ss=0;
Uchar a[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xbf}; / / digital code
//0~9, -
Uchar b[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; / / position control code
The following is the time separation procedures ***********/ /**********
Void (timerpaly)
{
Buf[0]= sec%10;
Buf[1]= sec/10;
Buf[2]= 10;
Buf[3]= min%10;
Buf[4]= min/10;
Buf[5]= 10;
Buf[6]=hour%10;
Buf[7]=hour/10;
}
The following /********** timer initialization procedure ***********/
Void (Timert)
{
TMOD=0x11; / / working mode 1.
TH1=0xdc;
TL1=0x00; / / 10ms timing
TH0=0xdc;
TL0=0x00; / / 10ms timing
EA=1; / / open interrupt
ET1=1; / /
ET0=1; / / allow timer interrupt
TR1=1; / / T1
TR0=0; / / t0
}
The following /********** delay procedures ***********/
Void Delayms (uint XMS)
{
Uint I, j;
For (i=0; i=xms; i++)
For (j=115; j0; j--);
}
The following is a /********** time display program ***********/
Void (Dispaly)
{
Uchar temp, i;
For (i=0; i8; i++)
{
P1=0; / / vanishing
Temp=buf[i];
P0=a[temp]; //p0 control code
Temp=b[i];
If (SS)
{
If (key==1 (i==1|i==0)) temp=0x00;
If (key==2 (i==4|i==3)) temp=0x00;
If (key==3 (i==6|i==7)) temp=0x00;
}
P1=temp; //p1 position control
Del
您可能关注的文档
- 太阳能控制器工作原理和使用说明(The working principle and instructions of solar energy controller).doc
- 太阳能灯的结构与原理(The structure and principle of solar energy lamp).doc
- 太阳能电池按全国有哪些信誉好的足球投注网站量(Solar cells are being searched nationwide).doc
- 太阳能成为世界各国能源新宠(Solar energy has become a new favorite of energy in the world)(Solar energy has become a new Solar energy has become a favorite of energy the world new in in the world).doc
- 太阳能电池板的介绍(Introduction of solar panels).doc
- 太阳能路灯的原理 物理(The principle physics of solar street lamps).doc
- 头一炮轰开闸门_5287(First gun blew open gate _5287)(头一炮轰开闸门_5287(第一枪吹开了门_5287)).doc
- 委拉斯贵支 纺织女工(Your textile worker).doc
- 威格士电磁阀1(The solenoid valve 1.).doc
- 威迅集团下的威迅教育和威迅线材现状(Weixun education and Wilson Wilson group under the situation of wire).doc
最近下载
- 某某医院手术质量安全提升行动方案(2023-2025年).docx
- 草乌采收及初加工技术规范.pdf
- 标准图集-20S515-钢筋混凝土及砖砌排水检查井.pdf VIP
- 嗜铬细胞瘤和副神经节瘤诊断治疗专家共识1护理课件.pptx VIP
- (全国Ⅰ卷)2017-2020年高考英语全国卷1试卷试题真题及答案.pdf
- 国开电大 《24211 学前儿童社会教育活动指导》期末考试题库(按字母排版) (1).pdf
- 嗜铬细胞瘤和副神经节瘤诊断治疗专家共识1.pptx VIP
- 嗜铬细胞瘤和副神经节瘤诊断治疗专家共识2020版.pptx VIP
- (全国Ⅱ卷)2017-2020年高考英语全国卷2试卷试题真题及答案.pdf
- 第八单元 第1课时 几分之一(教学课件)三年级数学上册人教版.ppt
文档评论(0)