************************************** void timer0() interrupt 1 using 2 {
TH0=0xff; TL0=0xa0;
time_wang++; if(SHOW==0) {
if(time_wang==5) {
P2=0xff;
B0=0;B1=1;B2=1;B3=1; P2=~table[mun/1000];
}
if(time_wang==10) {
P2=0xff;
B0=1;B1=0;B2=1;B3=1; P2=~table[(mun00)/100];
}
if(time_wang==15) {
- 8 -
P2=0xff;
B0=1;B1=1;B2=0;B3=1;
P2=(~table[(mun0)/10])&0x7f;
} }
if(SHOW==1) {
if(time_wang==5) {
if(time_wang==20) { }
time_wang=0; P2=0xff;
B0=1;B1=1;B2=1;B3=0; P2=~table[mun];
P2=0xff;
B0=0;B1=1;B2=1;B3=1; P2=~0x38;
}
if(time_wang==10) {
- 9 -
P2=0xff;
B0=1;B1=0;B2=1;B3=1; P2=0xff;
}
if(time_wang==15) {
P2=0xff;
B0=1;B1=1;B2=0;B3=1; P2=~table[wendu_L/10];
} }
if(SHOW==2) {
if(time_wang==5) {
- 10 -
if(time_wang==20) { }
time_wang=0; P2=0xff;
B0=1;B1=1;B2=1;B3=0; P2=~table[wendu_L];
P2=0xff;
B0=0;B1=1;B2=1;B3=1; P2=~0x76;
}
if(time_wang==10) {
P2=0xff;
B0=1;B1=0;B2=1;B3=1; P2=0xff;
}
if(time_wang==15) {
P2=0xff;
B0=1;B1=1;B2=0;B3=1; P2=~table[wendu_H/10];
}
if(time_wang==20) {
time_wang=0; P2=0xff;
B0=1;B1=1;B2=1;B3=0; P2=~table[wendu_H];
- 11 -
}
}
}
//---------------------------------
//********************************************************** void key_scan(void) {
if(!K1) //启动 { } if(!K2) {
delay(100); if(SHOW==0)return; if(SHOW==1) {
if(wendu_L==(wendu_H-1)) delay(100); SHOW++;
if(SHOW==3)SHOW=0;
return;
- 12 -
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库51单片机温度计 - 图文(4)在线全文阅读。
相关推荐: