文件名称:
基于郭天祥单片机数码管的电子钟(含闹钟、整点报时).pdf
开发工具:
文件大小: 865kb
下载次数: 0
上传时间: 2019-09-14
详细说明:基于郭天祥单片机数码管的电子钟(含闹钟、整点报时)pdf,mon 1=03
day1=10;
void display(uchar hour, uchar min, uchar sec)
uchar s1, s2. m1. m2 h1 h2
s2=sec/10;
s1=sec%10;
m2=min/10;
m1=min%10
h2=hour/10
h1=hour%10
dula=1
PO=table[h2
dula=O
PO=OXFF
wela=1
PO=OXFE:
delay (1)
dula=1
PO=table[h1]+0X80
dula=o:
P0=OXFF
wela=1
P0=OXFd
delay (1)
dula=1
PO=table[m2
dula=O:
P0=OXFF
wela=1
PO=0XFb
delay (1)
dula= 1
PO=table[m1]+0X80
dula=0:
P0=OXFF.
wela=1
P0=OXF7
delay (1)
dula=1
PO=table[s2
dula=O
P0=OXFf
wela=1
P0=OXef
delay(1)
dula=1
Po- table[s们
dula=o
PO=OXFF
wela=1
P0=0Xdf.
delay (1)
void keyscan(
f(key1==0)
delay (10)
if(key1==0)
TRO=O
temp1++;
if(temp 1
temp1=0
TR0=1
while(lkey 1
switch(temp2
case 0: display(hour, min1, sec1); break
case 1: display(year1, mon1, day 1); break;
case 2: display(hour2, min2, sec2); break;
f(key2==0)
delay (10)
if(key 2==0)
if (temp2==0)
i TRO=0;
switch ( temp1)
case 1: sec1++; if(sec1=60)sec1=0; break;
case 2: min 1 ++; if(min 1==60)min 1=0; break;
case 3: hour1++; if(hour==24 )hour=0; break
while(lkey2
display (hour1, min1, sec1);
if (temp2==1)
i TRO=1
switch(temp1
case 1: day 1++;if(day 1==31 )day1=1; break;
case 2: mon1++; if(mon1==13)mon1=1; break;
case 3 year 1++; if (year1==100)year1=0; break;
while(lkey2)
display(year1, mon1, day 1)
if(temp2==2)
{TR0=1;
switch(temp1)
case 1: sec2++;if(sec2==60) sec2=0; break
case 2: min2++; if(min2==60)min2=0; break;
case 3: hour2++; if (hour 2==24)hour 2=0; break;
while( key2)
display (hour2, min2, sec2);
if(key3==0)
delay (10)
if(key 3==0
if(temp2==0)
i TRO=0;
switch( temp1)
case 1: if(sec1==0) sec1=60; sec1--; break
case 2: f(min1==0)min1=60 min-; break;
case 3: if (hour==O)hour1=24; hour1-- break
while(lkey 3)
display(hour, mint, sec1);
if (temp2==1)
i TRO=1;
switch(temp1)
case 1: if(day 1==1)day 1=31; day 1- break
case 2: if(mon1==1)mon1=13; mon1-; break;
case 3: if(year1==O)year1=100: year1- break
while( key3)
display(year1, mon1, day1);
if(temp2==2
1 TRO=
switch(temp1)
case 1: if (sec2==0)sec2=60; sec2-; break
case 2: if(min2==0)min2=60; min2-; break
case 3: if (hour2==O)hour2=24; hour2-- break;
while(lkey 3)
display( hour2, min2, sec2);
if(key4==0)
delay (10)
if (key4==0)
temp1=0;
temp2++
if(temp2==3
temp2=0
while (lkey4
switch(temp2
case 0: display(hour, mini, sec1); break
case 1: display(yeart, mon1, day 1 ) break
case 2: display(hour2, min2, sec2); break;
switch(temp2)
case 0: display(hour, min1, sec1): break
case 1: display(year1, mon1, day 1): break;
case 2: display(hour 2, min2, sec2); break;
void alarm
uint
if(hour==hour2&&min1==min2&&(sec1>=sec2&&sec1
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.