单片机技术网|技术阅读
登录|注册

您现在的位置是:单片机技术网 > 技术阅读 > 基于51单片机的智能恒温箱设计--数码管显示

基于51单片机的智能恒温箱设计--数码管显示

.

       51AT89C52使DS18B2050

   51++++++LED++

   

.

1DS18B20099.90.1

2

3

.

(1)AD,

2Protues仿

3PCB


.

1

2


3

/**********/void main(void){ uint z; InitTimer(); // EA=1; // TR0=1; ET0=1; //0 IT0=1; IT1=1; check_wendu();// check_wendu(); for(z=0;z<300;z++) { Disp_init(); } while(1) { // P3=0xff; if(SET==0) { Delay(2000); do{}while(SET==0); set_st++;x=0;shanshuo_st=1; if(set_st>2)set_st=0; } if(set_st==0) { EX0=0; //0 EX1=0; //1 check_wendu(); Disp_Temperature(); Alarm(); // } else if(set_st==1) { BEEP=1; // ALAM=1; ALAM1=1; EX0=1; //0 EX1=1; //1 if(x>=10){shanshuo_st=~shanshuo_st;x=0;} if(shanshuo_st) {Disp_alarm(shangxian);} } else if(set_st==2) { BEEP=1; // ALAM=1; ALAM1=1; EX0=1; //0 EX1=1; //1 if(x>=10){shanshuo_st=~shanshuo_st;x=0;} if(shanshuo_st) {Disp_alarm(xiaxian);} } }}
/*****0*****/void timer0(void) interrupt 1{ TH0=0x3c; TL0=0xb0; x++;}/*****0*****/void int0(void) interrupt 0{ EX0=0; //0 if(DEC==0&&set_st==1) { do{ Disp_alarm(shangxian); } while(DEC==0); shangxian--; if(shangxian<xiaxian)shangxian=xiaxian; } else if(DEC==0&&set_st==2) { do{ Disp_alarm(xiaxian); } while(DEC==0); xiaxian--; if(xiaxian<0)xiaxian=0; }}