if(num==1) {
if(k2==0) { delayms(10); if(k2==0) { th++; if(th==100) th=25; while(!k2); } }
if(k3==0) { delayms(10); if(k3==0) { th--; if(th==0) th=25; while(!k3); } } }
/***********设置下限温度********/ if(num==2) {
if(k2==0) {
delayms(10); if(k2==0) {
low++; if(low==40) low=15; while(!k2); } }
if(k3==0) {
delayms(10); if(k3==0)
22
{ low--; if(low==0) low=15; while(!k3); } } }
/******设置上限湿度******/ if(num==4) {
if(k2==0) { delayms(10); if(k2==0) { sth++; if(sth==100) sth=70; while(!k2); } }
if(k3==0) { delayms(10); if(k3==0) { sth--; if(sth==0) sth=70; while(!k3); } } }
/*******设置下限湿度*******/ if(num==5) {
if(k2==0) {
delayms(10); if(k2==0) {
sl++; if(sl==60) sl=30;
23
while(!k2); } } if(k3==0) { delayms(10); if(k3==0) { sl--; if(sl==0) sl=30; while(!k3); } } } } }
/*******显示当前温度*****/ void display1() { a=temp1/10; b=temp1; P2=0xbf; P0=0xc6; delayms(10); P2=0xef; P0=led[a]; delayms(10); P2=0xf7; P0=led[b]; delayms(10); }
/*******设置上限温度******/ void display2() { uchar c,d; c=th/10; d=th; P2=0xbf; P0=0x89;
24
delayms(10); P2=0xef; P0=led[c]; delayms(10); P2=0xf7; P0=led[d]; delayms(10); }
/*****设置温度下限*******/ void display3() { uchar e,f; e=low/10; f=low; P2=0xbf; P0=0xc7; delayms(10); P2=0xef; P0=led[e]; delayms(10); P2=0xf7; P0=led[f]; delayms(10); }
/*******温度超过或低于设定值报警******/ void sound() { if(temp1
/***********湿度超出设定值报警************/
25
相关推荐: