谁有电子万年历的C语言程序?使用AT89S52单片机,DS18B20温度传感器,DS1302时钟芯片和LCD1602显示模块。 10
能不能把这个程序也给我呀,谢谢了,要对的,网上许多错误的!后天就交了!845256650@qq.com...
能不能把这个程序也给我呀,谢谢了,要对的,网上许多错误的!后天就交了!845256650@qq.com
展开
2个回答
展开全部
#include"sub_ej51.c" //
ulong Time_354ms;
void time()_inter(void) interrupt 1
{++Time_35ms;}
void main(void)
{ulong clock;
uchar ss; uchar save;
uchar buf[5];
uchar kk;
bit b_sz=0;
init_jp_dz();
clr_led_dz();
TMOD=0x21;
TR0=1;
ET0=1;
EA=1;
for(;;){
kk=read_key();
if(kk='5'){
b_sz=~b_sz;
if(b_sz!=0){led_blink(o,1);}
else{led_blink(0.0);}
}
else if(kk=='A'){
TR0=0;ET0=0;EA=0;return;}
else if(kk!=0&&b_sz!=0){
swith(kk){
case'0':Time_35ms+=101250;break;
case'6':Time_35ms-=101250;break;
case'1':Time_35ms+=1680;break;
case'7':Time_35ms-=1680;break;
case'2':Time_35ms+=28;break;
case'8'Time_35ms-=28;break;
case'3':Time_35ms+=2430000;break;
case'9':Time_35ms-=2430000;break;
}
}
clock=Time_35ms*32/900;
ss=clock%60;
if(ss!=save||b_sz!=0){
sprintf(buf,"%02bd",ss);
led_string(6,buf);
sprintf(buf,"%02|d-",(clock%3600)/60);
led_string(3,buf);
sprintf(buf,"%02|d-',(clock%86400)/3600);
led_string(0,buf);
dz_putchar((clock%604800)/86400+0x30);
save=ss;
}
}
}
ulong Time_354ms;
void time()_inter(void) interrupt 1
{++Time_35ms;}
void main(void)
{ulong clock;
uchar ss; uchar save;
uchar buf[5];
uchar kk;
bit b_sz=0;
init_jp_dz();
clr_led_dz();
TMOD=0x21;
TR0=1;
ET0=1;
EA=1;
for(;;){
kk=read_key();
if(kk='5'){
b_sz=~b_sz;
if(b_sz!=0){led_blink(o,1);}
else{led_blink(0.0);}
}
else if(kk=='A'){
TR0=0;ET0=0;EA=0;return;}
else if(kk!=0&&b_sz!=0){
swith(kk){
case'0':Time_35ms+=101250;break;
case'6':Time_35ms-=101250;break;
case'1':Time_35ms+=1680;break;
case'7':Time_35ms-=1680;break;
case'2':Time_35ms+=28;break;
case'8'Time_35ms-=28;break;
case'3':Time_35ms+=2430000;break;
case'9':Time_35ms-=2430000;break;
}
}
clock=Time_35ms*32/900;
ss=clock%60;
if(ss!=save||b_sz!=0){
sprintf(buf,"%02bd",ss);
led_string(6,buf);
sprintf(buf,"%02|d-",(clock%3600)/60);
led_string(3,buf);
sprintf(buf,"%02|d-',(clock%86400)/3600);
led_string(0,buf);
dz_putchar((clock%604800)/86400+0x30);
save=ss;
}
}
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询