freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

多點(diǎn)溫度及濕度控制系統(tǒng)設(shè)計(jì)電子信息工程技術(shù)專業(yè)畢業(yè)設(shè)計(jì)畢業(yè)論文-資料下載頁

2025-01-18 15:14本頁面
  

【正文】 // makes a measurement (humidity/temperature) with checksum{ unsigned error=0。unsigned int i。s_transstart()。 //transmission startswitch(mode){ //send mand to sensor case TEMP : error+=s_write_byte(MEASURE_TEMP)。 break。 case HUMI : error+=s_write_byte(MEASURE_HUMI)。 break。 default : break。 }for (i=0。i65535。i++) if(DATA==0) break。 //wait until sensor has finished the measurementif(DATA) error+=1。 // or timeout (~2 sec.) is reached*(p_value) =s_read_byte(ACK)。 //read the first byte (MSB)*(p_value+1)=s_read_byte(ACK)。 //read the second byte (LSB)*p_checksum =s_read_byte(noACK)。 //read checksumreturn error。}/*//void init_uart()////9600 bps @ MHz {SCON = 0x52。 TMOD = 0x20。 TCON = 0x69。 TH1 = 0xfd。 } *///void calc_sth11(float *p_humidity ,float *p_temperature)//// calculates temperature [癈] and humidity [%RH] // input : humi [Ticks] (12 bit) // temp [Ticks] (14 bit)// output: humi [%RH]// temp [癈]{ const float C1=。 // for 12 Bitconst float C2=+。 // for 12 Bitconst float C3=。 // for 12 Bitconst float T1=+。 // for 14 Bit @ 5Vconst float T2=+。 // for 14 Bit @ 5V float rh=*p_humidity。 // rh: Humidity [Ticks] 12 Bit float t=*p_temperature。 // t: Temperature [Ticks] 14 Bitfloat rh_lin。 // rh_lin: Humidity linearfloat rh_true。 // rh_true: Temperature pensated humidityfloat t_C。 // t_C : Temperature [癈]t_C=t* 40。 //calc. temperature from ticks to [癈]rh_lin=C3*rh*rh + C2*rh + C1。 //calc. humidity from ticks to [%RH]rh_true=(t_C25)*(T1+T2*rh)+rh_lin。 //calc. temperature pensated humidity [%RH]if(rh_true100)rh_true=100。 //cut if the value is outside ofif(rh_true)rh_true=。 //the physical possible range*p_temperature=t_C。 //return temperature [癈]*p_humidity=rh_true。 //return humidity[%RH]}///*float calc_dewpoint(float h,float t)//// calculates dew point// input: humidity [%RH], temperature [癈]// output: dew point [癈]{ float logEx,dew_point。logEx=+*t/(+t)+(log10(h)2)。dew_point = (logEx )*(+)。return dew_point。}*///延時(shí)子程序void delay(unsigned int m)//{ for(。m0。m) { _nop_()。 }}/*//顯示程序void data_show(unsigned int hum_measure,unsigned int temp_measure ){ unsigned char i,j,k,y。// unsigned int y。unsigned char *dat, da[]={0xc0,0xf9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x84,0xFF}。// 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,88H,83H,0C6H,0A1H,86H,84H,0FFH。共陽0~f字型碼 i=hum_measure%10。 //i是濕度的最后四位//y=hum_measure。j=hum_measure/10。 //k=temp_measure。 y=k%10。k/=10。dat=da。P1=0x20。 // 濕度十位 P0=*(dat+j)。p36=1。_nop_()。p36=0。delay(80)。P1=0x10。 //濕度個(gè)位P0=*(dat+i)。p36=1。_nop_()。p36=0。delay(80)。 P1=0x80。 //溫度十位P0=*(dat+k)。p36=1。_nop_()。p36=0。delay(80)。P1=0x40。 // 溫度個(gè)位P0=*(dat+y)。p36=1。_nop_()。p36=0。delay(80)。} *///void readTH(float *r_humidity,float *r_temperature)//// sample program that shows how to use SHT11 functions// 1. connection reset // 2. measure humidity [ticks](12 bit) and temperature [ticks](14 bit)// 3. calculate humidity [%RH] and temperature [癈]// 4. calculate dew point [癈]// 5. print temperature, humidity, dew point { value humi_val,temp_val。// float dew_point。unsigned char error,checksum。unsigned int k=2。//init_uart()。s_connectionreset()。while(k){ error=0。 error+=s_measure((unsigned char*) amp。,amp。checksum,HUMI)。 //measure humidity error+=s_measure((unsigned char*) amp。,amp。checksum,TEMP)。 //measure temperature if(error!=0) s_connectionreset()。 //in case of an error: connection reset else { =(float)。 //converts integer to float =(float)。 //converts integer to float calc_sth11(amp。,amp。)。 //calculate humidity, temperature //dew_point=calc_dewpoint(,)。 //calculate dew point //printf(temp:% humi:%%% dew point:%\n,dew_point)。 }*r_humidity=。*r_temperature=。 //wait approx. to avoid heating up SHTxx //for (i=0。i100。i++)//{ delay(20)。// data_show(,)。// }。 //(be sure that the piler doesn39。t eliminate this line!) //
點(diǎn)擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1