資源簡(jiǎn)介
溫度檢測(cè)控制系統(tǒng):51單片機(jī)與adc0809構(gòu)成的數(shù)碼管顯示C語(yǔ)言溫度系統(tǒng),功能強(qiáng)大;

代碼片段和文件信息
#include
sbit?CLK=P2^1;
sbit?st=P2^2; ?
sbit?eoc=P2^3;
sbit?tube4=P2^4;
sbit?tube3=P2^5;
sbit?tube2=P2^6;
sbit?tube1=P2^7;
sbit?test=P3^0;
sbit?ts=P3^1;
sbit?S=P3^3;
sbit?ten=P3^4;
sbit?sub=P3^5;
sbit?M=P3^6;
sbit?add=P3^7;
int??x;
int??u=150;v=1234;w=10;y=400;p=534;c=300;????????????????
int??a=0;b=0;d=0;e=0;f=0;g=0;h=0;k=0;m=0;n=0;o=0;
?????r=0;q=0;s=0;l=0;a1=0;b1=0;????????
int?save[24];
unsigned?char?code?table[]={0x3f0x060x5b0x4f0x66
????????????????????????????0x6d0x7d0x070x7f0x6f};?
void?delay()???//---------延時(shí)子程序??
{
char?ij;
for(i=100;i>0;i--);?????
for(j=100;j>0;j--);
}
void?int_isr()?//---------設(shè)定定時(shí)器模式
{
?? TMOD=0x01;
TR0=1; ??
ET0=1;
EA?=1;
}
void?Time1(void)?interrupt?1??//---------定時(shí)器工作子程序
{?
TH0?=(65535-100)/256?; //------100us
TL0?=(65535-100)%256?;
CLK=~CLK;?
q++;
if(q==1000)???//------0.1s
??{?
??c--;p--;q=0;
if(c<0)
??{c=300;}?
??}??
}? ?
void?adc() //----------------------ADC控制轉(zhuǎn)換子程序
{
????st=0;st=1;st=0;???
while(!eoc);???? ??
x=P0;x=x*39.22/10;
}
void?dis(int?t?)?//-----------------顯示子程序
{?
????int?t1t2t3t4;
????????t1=t/1000;?t2=t%1000/100;
t3=t%100/10;t4=t%10;? ??
if(a1==0)
??{tube4=0;}?//--------------省電控制
??????P1=table[t4];
??delay();tube4=1;
if(t!=v)
???{??
???if(a1==0&&t>0)
?????{
??tube3=0;
??}
?}
else
???{?if(a1==0&&t>=10)
???????{tube3=0;}
??}
if(t!=v) //----------兩種顯示模式的切換
??????{P1=table[t3]+0x80;}
else
??{P1=table[t3];}
??delay();tube3=1;
if(a1==0&&t>=100)
??{tube2=0;}
??????P1=table[t2];
??delay();tube2=1;
?? if(a1==0&&t>=1000)
??{tube1=0;}
??????P1=table[t1];
??delay();tube1=1;
}
?? ?? ??
void?report()?//---------------報(bào)警程序
{
????if(x>=y)?{test=0;}
else?????{test=1;}
}
void?pick() ?//----------------采集儲(chǔ)存歷史溫度程序
{
???if(n<=23)
?{save[n]=x;n++;}
}
void?key()?//------------------按鍵子程序
{
if(add==0&a!=0&&b1==0)?//--------“+“鍵定義
??????{f=1;}
????if(f==1&&add==1)
??{e=1;}
if(sub==0&&a!=0&b1==0)?//--------“—“鍵定義
??{m=1;}
if(m==1&&sub==1)
??{r=1;}
if(S==0)?//---------------------“鎖屏省電“鍵定義
??{l=1;c=u*0.89;}?//-----0.89為計(jì)時(shí)誤差校正系數(shù)
if(l==1&&S==1)
??{ l=0;b1++;
if(b1>2){a1=0;b1=0;a=0;b=0;ts=1;}
??}
if(b1==1)
??{
while(c!=0)
??{
????????dis(x); ??//-----------------鎖屏
????????if(c==0)
??????{a1=1;b1=2;}
??????}
if(a1==1)
??{ts=0;}
??} ?
?? if(M==0&&b1==0)?//----------------“菜單“鍵定義
??{d=1;}
if(d==1&&M==1)
??{
d=0;a++;
????if(a>1&&b==0)
??{a=0;}
??}
if(ten==0&&a==2&&(b==1||b==2))?//----------------“十倍率“鍵封裝
??{k=1;}
if(k==1&&ten==1)?
??????{
??????k=0;h++;
??????if(h>1){h=0;}
??}
?
if(o==1)?//--------返回菜單模式
??{v=1234;a=1;b=0;o=0;}
//-------------------------------------------------------------
if(a==1)??????????//進(jìn)入菜單模式
??{?dis(v);
if(e==1)
??{
????e=0;f=0;b++;
??? if(b>4){
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????2549964??2012-12-26?07:58??溫控系統(tǒng)\溫度檢測(cè)控制系統(tǒng):51單片機(jī)與adc0809構(gòu)成的數(shù)碼管顯示溫度系統(tǒng),功能強(qiáng)大;實(shí)現(xiàn)溫度的檢測(cè),高溫報(bào)警,歷史溫度儲(chǔ)存,省電模式。報(bào)警溫度可調(diào),采集溫度時(shí)間間隔可調(diào),預(yù)先省電時(shí)間可調(diào)。。。。。。.doc
?????文件?????128626??2012-12-24?23:10??溫控系統(tǒng)\電路原理圖\136.DSN
?????文件????????742??2013-04-01?20:14??溫控系統(tǒng)\電路原理圖\136.PWI
?????文件??????54393??2012-12-19?16:38??溫控系統(tǒng)\電路原理圖\ISIS.dmp
?????文件?????123869??2003-01-01?01:40??溫控系統(tǒng)\電路原理圖\Last?Loaded?136.DBK
?????文件??????86569??2012-12-11?01:23??溫控系統(tǒng)\電路原理圖\電路2.ms10
?????文件??????86737??2003-01-01?03:33??溫控系統(tǒng)\電路原理圖\電路2.ms10?(Security?copy)
?????文件?????125859??2012-12-11?01:23??溫控系統(tǒng)\電路原理圖\電路3.ms10
?????文件?????126364??2003-01-01?01:55??溫控系統(tǒng)\電路原理圖\電路3.ms10?(Security?copy)
?????文件??????14200??2013-03-25?21:00??溫控系統(tǒng)\軟件\nb
?????文件???????8399??2013-03-25?21:00??溫控系統(tǒng)\軟件\nb.hex
?????文件?????????21??2013-03-25?21:00??溫控系統(tǒng)\軟件\nb.lnp
?????文件??????17951??2013-03-25?21:00??溫控系統(tǒng)\軟件\nb.M51
?????文件????????316??2013-03-25?21:52??溫控系統(tǒng)\軟件\nb.plg
?????文件??????54844??2013-03-25?21:52??溫控系統(tǒng)\軟件\nb.uvopt
?????文件??????13218??2012-12-24?12:55??溫控系統(tǒng)\軟件\nb.uvproj
?????文件??????55664??2012-12-26?06:20??溫控系統(tǒng)\軟件\nb_uvopt.bak
?????文件??????13023??2012-12-21?06:12??溫控系統(tǒng)\軟件\nb_uvproj.bak
?????文件???????5507??2013-03-25?21:52??溫控系統(tǒng)\軟件\wc.c
?????文件??????14593??2013-03-25?21:00??溫控系統(tǒng)\軟件\wc.LST
?????文件??????17982??2013-03-25?21:00??溫控系統(tǒng)\軟件\wc.OBJ
?????目錄??????????0??2013-04-01?20:15??溫控系統(tǒng)\電路原理圖
?????目錄??????????0??2013-04-01?20:15??溫控系統(tǒng)\軟件
?????目錄??????????0??2013-04-01?20:38??溫控系統(tǒng)
-----------?---------??----------?-----??----
??????????????3498841????????????????????24
評(píng)論
共有 條評(píng)論