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

正文內(nèi)容

單片機(jī)課程設(shè)計(jì)報(bào)告-基于單片機(jī)的數(shù)字溫度計(jì)設(shè)計(jì)-閱讀頁(yè)

2024-11-16 12:12本頁(yè)面
  

【正文】 應(yīng)答 Delay(125)。 //跳過 ROM 命令 WrByte(0xbe)。 //溫度值低字節(jié),低 4 位為小數(shù) temphigh = RdByte()。 //溫度為 16 位補(bǔ)碼 if(temp0) //負(fù)溫度 { flag = 0。 } tempzheng = temp 4。 0x000f。 //溫度值小數(shù) if(flag) //正溫度 disp[0] = tempzheng/100。 //負(fù)號(hào) disp[1] = (tempzheng%100)/10。 //個(gè)位 disp[3] = tempxiao。 j=0x08。i4。 //數(shù)碼管位碼輸出 LOCK=1。 //顯示小數(shù)點(diǎn) else P0=led[disp[i]]。 //關(guān)閉鎖存 j=j1。 P0=0x00。 雖然以前做過類似的實(shí)驗(yàn),但這次的課程設(shè)計(jì)還是讓我學(xué)到了很多東西, 單片機(jī)課程設(shè)計(jì)重點(diǎn)就在于軟件 算法的設(shè)計(jì),需要有很巧妙的程序算法 。 通過這次的單片機(jī)課程設(shè)計(jì)我認(rèn)識(shí)到了,學(xué)習(xí)要理論聯(lián)系實(shí)際 ,把學(xué)到的理論知識(shí)同實(shí)際運(yùn)用相結(jié)合,才能是我們的知識(shí)融匯貫通,才能真正的學(xué)到知識(shí),真正的做到學(xué)以致用。 //數(shù)碼管碼表 uchar disp[4]={1,2,3,4}。 //74573 鎖存端 sbit DQ=P3^5。 //溫度值低字節(jié) uchar temphigh。 //溫度值整數(shù) char tempxiao。 void Display()。 void RxWait()。 uchar RdByte()。 void WrByte(uchar d)。 void RdTemp()。 sbit ACC7 = ACC^7。 //調(diào)用啟動(dòng)溫度轉(zhuǎn)換函數(shù) RdTemp()。 DQ=0。 while(i0) i。 //釋放總線 i=4。 } /* 等待 DS18B20 應(yīng)答 */ void RxWait() { uint i。 //等待 1560us while(~DQ)。 while(i0) i。 bit b。 //讀開始 1us i++。 //產(chǎn)生讀時(shí)間隙 15us i++。 b = DQ。 while(i0) i。 //釋放總線 return b。 d=0。i8。 d=(j7)|(d1)。 } /* 寫入字節(jié)數(shù)據(jù) */ void WrByte(uchar d) { uint i。 bit btmp。j8。0x01。 if(btmp) //寫 1 { DQ=0。 i++。 //寫 1 時(shí)隙不低于 60u i=8。 } else //寫 0 { DQ=0。 while(i0) i。 //釋放總線 i++。 } } } /* 啟動(dòng)溫度轉(zhuǎn)換 */ void Convert() { uint i。 //延時(shí) 1ms TxReset()。 //等待 DS18B20 應(yīng)答 Delay(125)。 //跳過 ROM 命令 WrByte(0x44)。i } /* 讀取溫度值 */ void RdTemp(void) { short int temp。 bit flag = 1。 //初始化 DS18B20 RxWait()。 //延時(shí) WrByte(0xcc)。 //讀暫存存儲(chǔ)器命令 templow = RdByte()。 //溫度值高字節(jié) temp = (temphigh 8) | templow。 temp = ~temp + 1。 //溫度值整數(shù) x = temp amp。 tempxiao = (x*10)/16。 //百位 else //負(fù)溫度 disp[0] = 16。 //十位 disp[2] = tempzheng%10。 //小數(shù) } /* 延時(shí) */ void Delay(uint x) { uint i。i0。 } /* 數(shù)碼管顯示 */ void Display() { uchar i,j。 for(i=0。i++) { P1=j。 //打開鎖存 if(i==2) P0=led[disp[i]]|0x01。 //數(shù)碼管段碼輸出 LOCK=0。 //調(diào)整位碼 Delay(125)。 } }
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1