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

正文內(nèi)容

基于51單片機用lcd1602顯示的ds18b20課程設(shè)計鍵控上下限警報功能-資料下載頁

2025-06-24 03:45本頁面
  

【正文】 初始化子程序{ LcdWriteCom(0x38)。 LcdWriteCom(0x0c)。 LcdWriteCom(0x06)。 LcdWriteCom(0x01)。 LcdWriteCom(0x80)。 }elsevoid LcdInit() { LcdWriteCom(0x32)。 LcdWriteCom(0x28)。 LcdWriteCom(0x0c)。 LcdWriteCom(0x06)。 LcdWriteCom(0x01)。 LcdWriteCom(0x80)。 }endifincludevoid Delay1ms(unsigned int y) //延時{ unsigned int x。 for(y。y0。y) for(x=110。x0。x)。}unsigned char Ds18b20Init() //初始化{ unsigned int i。 DSPORT=0。 i=70。 while(i)。 DSPORT=1。 i=0。 while(DSPORT) { i++。 if(i5000) return 0。//失敗 } return 1。//成功}void Ds18b20WriteByte(unsigned char dat) //寫字節(jié){ unsigned int i,j。 for(j=0。j8。j++) { DSPORT=0。 //每寫入一位數(shù)據(jù)之前先把總線拉低1us (數(shù)據(jù)手冊上模糊) i++。 DSPORT=datamp。0x01。 i=6。 while(i)。 DSPORT=1。 dat=1。 }}unsigned char Ds18b20ReadByte(){ unsigned char byte,bi。 unsigned int i,j。 for(j=8。j0。j) { DSPORT=0。 i++。 DSPORT=1。 i++。 i++。 bi=DSPORT。 byte=(byte1)|(bi7)。 i=4。 while(i)。 } return byte。}void Ds18b20ChangTemp() //溫度轉(zhuǎn)換{ Ds18b20Init()。 Delay1ms(1)。 Ds18b20WriteByte(0xcc)。 Ds18b20WriteByte(0x44)。 }void Ds18b20ReadTempCom() //讀取溫度命令{ Ds18b20Init()。 Delay1ms(1)。 Ds18b20WriteByte(0xcc)。 Ds18b20WriteByte(0xbe)。 }int Ds18b20ReadTemp() //讀取溫度{ int temp=0。 unsigned char tmh,tml。 Ds18b20ChangTemp()。 Ds18b20ReadTempCom()。 tml=Ds18b20ReadByte()。 tmh=Ds18b20ReadByte()。 temp=tmh。 temp=8。 temp|=tml。 return temp。}7. 心得體會 通過兩個星期的努力,我的單片機課程設(shè)計基于DS18B20的溫度顯示系統(tǒng),終于完成了。雖然功能還不是很完善但卻讓我通過此次設(shè)計學(xué)會了不少東西。學(xué)會了keil和proteus軟件的使用,從原本的生澀到現(xiàn)在的純熟,是一個進步的過程!并且自己用C語言來編寫代碼,又通過這次課程設(shè)計學(xué)到了很多東西,部分跟C不太一樣,通過網(wǎng)絡(luò)的查找與應(yīng)用,取得了不錯的成效! 這次課程設(shè)計讓我清楚的認識到只有理論與實踐相結(jié)合才是真正的學(xué)習(xí)!為了自己的將來,我定會認真學(xué)好大學(xué)課程,在圖書館與網(wǎng)絡(luò)上拓寬自己的知識(網(wǎng)絡(luò)對我們的幫助很大),努力進取,實現(xiàn)自己的抱負與理想!8. 參考文獻1. 張俊謨著 《單片機中級教程》,(第二版)。2. 《C語言課程設(shè)計》,山東農(nóng)業(yè)大學(xué)版。仿真的最終效果圖如上34
點擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1