91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 34KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發布日期: 2021-10-21
  • 語言: 其他
  • 標簽: MCS-51??時鐘??

資源簡介

本科期間使用protues和keil聯合仿真的C51單片機八段LED靜態顯示電子時鐘,內含protues圖及MCS-51源碼

資源截圖

代碼片段和文件信息

#include?
unsigned?char?code?table[11]={0x800xF20x480x600x320x240x040xF00x000x200xFF};//0~9黑
unsigned?char?secondminutehourdatemonthksmh[8]dmy[8]move_sign=0;?
unsigned?int?year;
sbit?P1_0=P1^0;
sbit?P1_1=P1^1;
sbit?P1_2=P1^2;
sbit?P1_3=P1^3;
sbit?P1_4=P1^4;
sbit?P1_5=P1^5;
sbit?P1_6=P1^6;
sbit?P3_2=P3^2;
void?show()
{?? unsigned?char?sbi; ?
P1_0=1;
if(P1_1==0)
{???for(i=0;i<8;i++)
{
sb=*(table+dmy[i]);
SBUF=sb;
TI=0;
while(!TI);
}
?}
else
{ for(i=0;i<8;i++)
{
sb=*(table+smh[i]);
SBUF=sb;
TI=0;
while(!TI);
}
}
P1_0=0;
}

void?runtime_0()
{??
second++;
if(second==60)?{second=0;minute++;}
if(minute==60)?{minute=0;hour++;}
if(hour==24)?
{
hour=0;date++;
switch(month)
{ case?1:
case?3:
case?5:
case?7:
case?8:
case?10:
case?12:
if(date==32)
{ date=1;
month++;
}
if(month==13)
{
month=1;
year++;
}
break;
case?4:
case?6:
case?9:
case?11:
if(date==31)
{
date=1;
month++;
}
break;
case?2:
if(year%4==0&&year%100!=0||year%400==0)
{
if(date==30)
{
date=1;
month++;
}
}
else?if?(date==29)
{
date=1;
month++;
}
break;
}
}
if(year==10000)year=1;
}

void?div()
{??
smh[0]=second%10;
smh[1]=second/10;
smh[2]=minute%10;
smh[3]=minute/10;
smh[4]=hour%10;
smh[5]=hour/10;

dmy[0]=date%10;
dmy[1]=date/10;
dmy[2]=month%10;
dmy[3]=month/10;
dmy[4]=year%10;
dmy[5]=year/10%10;
dmy[6]=year/100%10;
dmy[7]=year/1000;

}

void?timer0()?interrupt?1?using?1 //T0為第1中斷,INT0為第0中斷
{
TH0=0x63;
TL0=0x1f;?
k++;
if(k==50)
{ k=0;
runtime_0();
div();
show();
}
}

void?delay(unsigned?char?timeiunsigned?char?timej)
{
unsigned?char?i;
unsigned?int?j;
for(i=0;i for(j=0;j {;}
}

void?inc(unsigned?char?move_sign)
{
???if(P1_1==0)
??? {
if(move_sign==1)
{
year++;
if(year==9999)
year=1;
}
if(move_sign==2)
{
month++;
if(month==13)
month=1;
}
if(move_sign==3)
{
date++;
switch(date)
{
case?29:
if(month==2&&!(year%4==0&&year%100!=0||year%400==0))
date=1;
break;
? case?30:
if(month==2&&year%4==0&&year%100!=0||year%400==0)
date=1;
break;
case?31:
switch(month)
? {
? case?4:
case?6:
case?9:
case?11:date=1;
}
break;
case?32:
switch(month)
{
case?1:
case?3:
case?5:
case?7:
case?8:
case?10:

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????2113??2007-12-17?22:16??time.Uv2

?????文件?????154709??2006-09-22?21:22??八位.DSN

?????文件???????5817??2007-07-25?00:08??靜態顯示.c

?????文件??????11300??2007-12-17?22:16??time

?????文件????????334??2007-12-17?22:16??time.plg

?????文件???????4374??2007-12-17?22:16??time.hex

?????文件?????????41??2007-12-17?22:16??time.lnp

?????文件??????19562??2007-12-17?22:16??time.M51

?????文件???????1315??2007-12-17?22:16??time.Opt

-----------?---------??----------?-----??----

???????????????199565????????????????????9


評論

共有 條評論