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

正文內(nèi)容

溫度監(jiān)測控制系統(tǒng)設(shè)計(jì)方案(已改無錯字)

2023-06-10 12:50:26 本頁面
  

【正文】 (shezhi=0)shezhi=0。 write_add(1,shezhi)。 dis_temp(shezhi)。 } } if(gaowen==1) { 1=read_add(3)。 g=1。 shezhi=g。 dis_temp(g)。 if(key3==0) { delay(10)。 if(key3==0)。 while(!key3)。 shezhi=shezhi+1。 if(shezhi=120)shezhi=120。 write_add(3,shezhi)。 dis_temp(shezhi)。 } if(key4==0) { delay(10)。 if(key4==0)。 while(!key4)。 if(shezhi==0) shezhi=0。 else shezhi=shezhi1。 //shezhi=shezhi1。 write_add(3,shezhi)。 dis_temp(shezhi)。 } }} 18B20溫度傳感器初始化void dsreset(void) //18B20復(fù)位,初始化函數(shù){ uint i。 ds=0。 i=103。 while(i0)i。 ds=1。 i=4。 while(i0)i。}void tempchange(void) //DS18B20 開始獲取溫度并轉(zhuǎn)換{ dsreset()。 delay(1)。 tempwritebyte(0xcc)。 // 寫跳過讀ROM指令 tempwritebyte(0x44)。 // 寫溫度轉(zhuǎn)換指令}***讀1位函數(shù)bit tempreadbit(void) //讀1位函數(shù){ uint i。 bit dat。 ds=0。i++。 //i++ 起延時(shí)作用 ds=1。i++。i++。 dat=ds。 i=8。while(i0)i。 return (dat)。}***讀1位函數(shù)uchar tempread(void) //讀1個(gè)字節(jié){ uchar i,j,dat。 dat=0。 for(i=1。i=8。i++) { j=tempreadbit()。 dat=(j7)|(dat1)。 //讀出的數(shù)據(jù)最低位在最前面,這樣剛好一個(gè)字節(jié)在DAT里 } return(dat)。} 讀出溫度子程序int get_temp() //讀取寄存器中存儲的溫度數(shù)據(jù){ uchar a,b。 dsreset()。 delay(1)。 tempwritebyte(0xcc)。 tempwritebyte(0xbe)。 a=tempread()。 //讀低8位 b=tempread()。 //讀高8位 temp=b。 b=bamp。0x0f8。//高五位符號位【重要】 temp=8。 //兩個(gè)字節(jié)組合為1個(gè)字 temp=temp|a。 if(b==0x0f8) //第11為開始為1是讀的值為負(fù)值 {temp=~temp+1。//實(shí)際的負(fù)溫度 LedOut[0]=0x40。//顯示負(fù)號 } f_temp=temp*。 //溫度在寄存器中為12位 176。 temp=f_temp*10+。 //乘以10表示小數(shù)點(diǎn)后面只取1位, f_temp=f_temp+。 return temp。 //temp是整型} 顯示數(shù)據(jù)刷新子程序void dis_temp(int t){ int i,LedNumVal。 LedNumVal=t。 //把實(shí)際溫度送到LedNumVal變量中 if(LedOut[0]==0x40)//第11為開始為1是讀的值為負(fù)值 { LedOut[0]==0x40。//顯示負(fù)號 } else {LedOut[0]=table[LedNumVal/1000]。}//百位 LedOut[1]=table[LedNumVal%1000/100]。//十位 if(flag==1) { LedOut[2]=table[LedNumVal%100/10]。//個(gè)位 } else { LedOut[2]=table[LedNumVal%100/10+10]。//個(gè)位+10為了顯示小數(shù)點(diǎn) } LedOut[
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1