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

正文內(nèi)容

基于at89s52單片機(jī)的溫濕度檢測儀-畢業(yè)設(shè)計(jì)-閱讀頁

2025-06-21 22:58本頁面
  

【正文】 DS18B20是否存在 發(fā)送跳過RAM指令溫度轉(zhuǎn)換LCD顯示NO2. 部分源程序如下: void init_lcd(){ write_zl(0x38)。//清屏 write_zl(0x06)。//不開光標(biāo) }void init_18b20(){ DQ=1。 //延時(shí) DQ=0。 DQ=1。}void write_dat(uchar dat){ uchar i,k。 for(i=0。i++) { DQ=0。0x01。 DQ=1。}delay(4)。for(j=0。j++) { DQ=1。 DQ=0。 DQ=1。 delay(4)。} void temperaturechange(){ uint tempH,tempL。 write_dat(0xcc)。 //啟動(dòng)溫度轉(zhuǎn)換 delay(60000)。// init_18b20()。 write_dat(0xbe)。//讀取溫度低位LSB tempH=read_sj()。0x80) //高5位是1為負(fù)數(shù) { a=1。 tem=8。 //合并高低位數(shù) tem=~tem+1。}else { a=0。//轉(zhuǎn)換實(shí)際溫度 }}void write_temperature(uint temp) //被調(diào)用的函數(shù)必須在前{ uint bai,shi,ge。 shi=temp%100/10。 if(a==1) { if(shi0) {write_zl(0x80+0x40+3)。39。 write_zl(0x80+0x40+4)。 } else { write_zl(0x80+0x40+3)。 write_zl(0x80+0x40+4)。39。} }else { if(bai0) //若bai顯示shi肯定顯示 { write_zl(0x80+0x40+3)。write_zl(0x80+0x40+4)。 } else { if(shi0) //否則判斷shi是否顯示{write_zl(0x80+0x40+4)。 }else{write_zl(0x80+0x40+4)。} write_zl(0x80+0x40+3)。 }}write_zl(0x80+0x40+5)。 } void sounderplay() { uint i。i1000。 delay(100)。 濕度檢測模塊程序設(shè)計(jì)1. 程序設(shè)計(jì)方案 2. 部分源程序如下: void main() { P25=0。P27=0。TMOD=0x20。TR1=1。 TL1=0xff。 init_lcd()。 displayyj()。 while(1) { yejing=1。 yejing=0。 display()。 if(flag==0) { yejing=1。 yejing=0。} void display(){ P35=1。P35=0。 //等待Ad轉(zhuǎn)換// P36=1。 b=51。 P20=1。P1=tab[c]。 delay(1)。f=a%b。P1=tab[d]。P21=1。P21=0。 鍵盤掃描和LED顯示模塊程序設(shè)計(jì)167。本設(shè)計(jì)的鍵盤就在此基礎(chǔ)上設(shè)計(jì)的,同時(shí)也為了節(jié)約單片機(jī)的硬件資源,具體程序如下:void key_set() //按鍵設(shè)置{ if(button1==0) { delay2(5)。 kk++。fly=1。 write_zl(0x0f)。 case 2:write_zl(0x80+11)。 case 3:write_zl(0x80+0x40+10)。 case 4:write_zl(0x80+0x40+11)。 case 5:kk=0。fly=0。 if(nn==1) fl=1。 break。 if(button2==0) { while(button2==0)。 if(fl==1){Ush++。 write_sj(0x30+Ush)。} if(fl==0){Ushi++。write_sj(0x30+Ushi)。} break。 if(fl==1){Ug++。write_sj(0x30+Ug)。} if(fl==0){ Uge++。 write_sj(0x30+Uge)。} break。 if(fl==1){Dsh++。write_sj(0x30+Dsh)。} if(fl==0){ Dshi++。write_sj(0x30+Dshi)。} break。 if(fl==1){Dg++。write_sj(0x30+Dg)。} if(fl==0){Dge++。write_sj(0x30+Dge)。} break。 if(button3==0) { while(button3==0)。 if(fl==0){Ushi。write_sj(0x30+Ushi)。} if(fl==1){Ush。 write_sj(0x30+Ush)。} break。 if(fl==0){Uge。write_sj(0x30+Uge)。} if(fl==1){Ug。 write_sj(0x30+Ug)。} break。 if(fl==0){Dshi。write_sj(0x30+Dshi)。} if(fl==1){Dsh。write_sj(0x30+Dsh)。} break。 if(fl==0){Dge。write_sj(0x30+Dge)。} if(fl==1){Dg。write_sj(0x30+Dg)。} break。 if(button4==0) { while(button4==0)。switch(nn){ case 1:fl=1。write_zl(0x0c)。 yejing=1。 //若不在這顯示數(shù)碼管閃爍 yejing=0。 case 2:fl=0。 write_zl(0x0c)。 nn=0。 } } } }該檢測儀采用獨(dú)立式鍵盤,關(guān)于它的具體硬件組成電路這里就不多做介紹,在檢測有無鍵按下方面主要用的是開機(jī)自動(dòng)掃描方式,該方式是利用單片機(jī)運(yùn)行程序初始化后自動(dòng)掃描鍵盤。 I2C總線程序設(shè)計(jì) 部分源程序如下所示:void start() { sda=1。 sck=1。 sda=0。} void stop() { sda=0。 sck=1。 sda=1。} void response() { uchar i。amp。 sck=1。 sck=0。 temp=sj。 delay(4)。j8。 sda=CY。 delay(4)。 delay(5)。//釋放總線 }uchar read_shj(){uchar k,n。 delay(4)。k8。 sck=1。 sck=0。} return(n)。 write_shj(0xa0)。 delay(2)。 response()。 write_shj(date)。 delay(2)。}uchar read_I2C(uchar qjnbdz){ uchar shuju。 write_shj(0xa0)。 delay(2)。 response()。 start()。 response()。 shuju=read_shj()。 return(shuju)。由于采用了測量范圍廣、精度高、響應(yīng)速度快的電阻式濕度傳感器來進(jìn)行濕度采樣,因此該檢測儀基本上達(dá)到技術(shù)指標(biāo)中對相對濕度測量精度和分辨力的要求。但是AT89S52單片機(jī)工作頻率較高,并且只有環(huán)境濕度較高時(shí)才會(huì)出現(xiàn)處理時(shí)間延長現(xiàn)象,因此并不影響檢測儀的實(shí)時(shí)檢測指標(biāo)。本設(shè)計(jì)的設(shè)計(jì)主要面臨著硬件設(shè)計(jì)和軟件設(shè)計(jì)的兩大問題,以及硬件和軟件的結(jié)合。在指導(dǎo)老師的悉心輔導(dǎo)下和查閱大量資料之后,然后采用了AT89S52單片機(jī)并配合其它一些元器件的硬件設(shè)計(jì)方案,使以上問題得到了很好改善 。由于這次設(shè)計(jì)的時(shí)間較短,該檢測儀的主要功能已經(jīng)實(shí)現(xiàn),要達(dá)到實(shí)用,還需繼續(xù)進(jìn)一步進(jìn)行研究設(shè)計(jì)。2004[7] 余永權(quán)。在每次設(shè)計(jì)遇到問題時(shí)老師不辭辛苦的講解才使得我的設(shè)計(jì)順利的進(jìn)行。C to +125176。C increments. Fahrenheit equivalent is –67176。F in 176。C, since it may not be able to sustain munications given the higher leakage currents the DS1820 exhibits at these temperatures. For applications in which such temperatures are likely, it is strongly remended that VDD be applied to the DS1820. For situations where the bus master does not know whether the DS1820’s on the bus are parasite powered or supplied with external VDD, a provision is made in the DS1820 to signal the power supply scheme used. The bus master can determine if any DS1820’s are on the bus which require the strong pull–up by sending a SkipROM protocol, then issuing the read power supply mand. After this mand is issued, the master then issues read time slots. The DS1820 will send back “0” on the 1–Wire bus if it is parasite powered。C. If the counter reaches zero before the gate period is over, the temperature register, which is also preset to the –55176。C. At the same time, the counter is then preset with a value determined by the slope accumulator circuitry. This circuitry is needed to pensate for the parabolic behavior of the oscillators over temperature. The counter is then clocked again until it reaches zero.If the gate period is still not finished, then this process repeats. The slope accumulator is used to pensate for the non–linear behavior of the oscillators over temperature, yielding a high resolution temperature measurement. This is done by changing the number of counts necessary for the counter to go through for each incremental degree in temperature. To obtain the desired resolution, therefore, both the value of the counter and the number of counts per degree C (the value of the slope accumulator) at a given temperature must be known.Internally, this calculation is done inside the DS1820 to provide 176。C to +125176。C increments. For Fahrenheit usage, a lookup table or conversion factor must be used.Note that temperature is r
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1