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

正文內(nèi)容

大空間火災監(jiān)控系統(tǒng)-建筑類畢業(yè)論文-資料下載頁

2025-06-27 13:58本頁面
  

【正文】 for(i=0。 is。 i++)。}/************************************************/ /* 初始化ds18b2子函數(shù)* */ /************************************************/ void Init_DS18B20(void) { uchar x=0。 DQ = 1。 //DQ復位 delayus(8)。 //稍做延時 DQ = 0。 //單片機將DQ拉低 delayus(80)。 //精確延時 大于 480us DQ = 1。 //拉高總線 delayus(14)。 x=DQ。 //稍做延時后 如果x=0則初始化成功 x=1則初始化失敗 delayus(20)。 } /*************************************************/ /* 讀字節(jié)子函數(shù) */ /*************************************************/ ReadOneChar(void) { uchar i = 0。 uchar dat = 0。 for (i=8。i0。i) { DQ = 0。 // 給脈沖信號 dat=1。 // 數(shù)據(jù)右移一位 DQ = 1。 // 給脈沖信號 if(DQ) // DQ為1 dat|=0x80。 // 讀出數(shù)據(jù) delayus(4)。 // 延時 } return(dat)。 } /*************************************************/ /* 寫字節(jié)子函數(shù) */ /*************************************************/ void WriteOneChar(unsigned char dat) { uchar i = 0。 for (i=8。 i0。 i) { DQ = 0。 DQ = datamp。0x01。 //寫入一位數(shù)據(jù) delayus(5)。 DQ = 1。 dat=1。 //右移一位數(shù)據(jù) } } /******************************************/ /* 發(fā)送溫度轉換命令 */ /******************************************/ void tmpchange(void) // DS18B20 begin change { Init_DS18B20()。 // 初始化DS18B20 delayus(200)。 // 延時 WriteOneChar(0xcc)。 // 跳過序列號命令 WriteOneChar(0x44)。 // 發(fā)送溫度轉換命令 } /******************************************/ /* 讀出溫度函數(shù) 并且顯示溫度 */ /******************************************/ //uint tmp() //get the temperature //{ // char a=0,b=0,c=0。// Init_DS18B20()。 // 初始化ds18b2子函數(shù) // delayus(1)。 // WriteOneChar(0xcc)。 // 跳過ROM命令 // WriteOneChar(0xbe)。 // 發(fā)送讀取數(shù)據(jù)命令 // temp_data[0]=ReadOneChar()。 // 連續(xù)讀兩個字節(jié)數(shù)據(jù) // temp_data[1]=ReadOneChar()。 // temp=temp_data[1]。 // temp=8。 // temp=temp|temp_data[0]。 // 兩字節(jié)合成一個整型變量。// TempBuffer[5]=temp_data[0]。// TempBuffer[6]=temp_data[1]。// // return temp。 // 返回溫度值 //} void printTemperature(void){ //寫一個字節(jié) uchar x,y,M,N,tt。 uint i=0。 float bb。 unsigned char a=0,b=0,c=0。 Init_DS18B20()。 // 初始化ds18b2子函數(shù) delayus(1)。 WriteOneChar(0xcc)。 // 跳過ROM命令 WriteOneChar(0xbe)。 // 發(fā)送讀取數(shù)據(jù)命令 temp=ReadOneChar()。 // 連續(xù)讀兩個字節(jié)數(shù)據(jù) tt=ReadOneChar()。 //低字節(jié) i=tt。 i=8。 i=i|temp。 //把溫度傳感器讀出的兩個字節(jié)轉換成一個字節(jié) if(ttamp。0xf8) { flag=1。 i=(~i+1)。 } //使用DS18B20的默認分辨率12位, , bb=i*。 i= bb*10+。 //放大10倍輸出并四舍五入 if(i=down*10|i=up*10) { beep=0。 Delay(1800)。 beep=1。 } else beep=1。 x=up/10。 y=up%10。 print2(0x89+5,x+0x30)。 print2(0x89+6,y+0x30)。 M=down/10。 N=down%10。 print2(0x89+0x40+5,M+0x30)。 print2(0x89+0x40+6,N+0x30)。 if(flag) print2(0x83,39。39。)。 a=i/100。 if(a 0x09) { print(0x84,)。 } else { print2(0x84,a+0x30)。 //顯示溫度十位 b=i/10a*10。 print2(0x85,b+0x30)。 //個位 print(0x86,.)。 //. c=ia*100b*10。 print2(0x87,c+0x30)。 //小位1位 } print2(0x88,0xdf)。 //度C print2(0x89,0x43)。 } //**********************************主函數(shù) **********************************/void main(void){ StartUART()。 init()。 //1602初始化 init_1602()。//1602開始畫面 Delay(6000)。 while(1) {// if(KEY1==0)// { // Delay(1000)。// if(KEY1==0)// {// up++。// while(!KEY1)。//松手檢測// }// }// if(KEY2==0)// { // Delay(1000)。// if(KEY2==0)// {// up。// while(!KEY2)。// }// }// if(KEY3==0)// { // Delay(1000)。// if(KEY3==0)// {// down++。// while(!KEY3)。// }// }// if(KEY4==0)// { // Delay(1000)。// if(KEY4==0)// {// down。// while(!KEY4)。// }// } printTemperature()。 }
點擊復制文檔內(nèi)容
環(huán)評公示相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1