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

正文內(nèi)容

室溫控制系統(tǒng)設(shè)計(jì)-畢業(yè)設(shè)計(jì)-資料下載頁(yè)

2025-08-06 09:23本頁(yè)面
  

【正文】 *//*void delay15us(void){ uchar i。 for(i=0。i2。i++)。}*//***************************************************************功能:復(fù)位脈沖 *************************************************************/bit resetpulse(void){ DQ=0。 delay600us()。 //延時(shí)500us DQ=1。 delay60us()。 // 延時(shí)60us return(DQ)。 //}/***************************************************************功能:ds18b20的初始化 *************************************************************/void ds18b20_init(void){ while(1) { if(!resetpulse()) //收到ds18b20的應(yīng)答信號(hào) { //printf(reset successful!)。 //delay240us()。 //延時(shí)240us DQ=1。 delay600us()。 //延時(shí)240us break。 } else resetpulse()。 //否則再發(fā)復(fù)位信號(hào) }}/***************************************************************功能:向ds18b20寫命令 *************************************************************/void ds18b20_writemand(uchar mand){ uchar i。 for(i=0。i8。i++) { if((mand amp。 0x01)==0) { DQ=0。 //寫0 delay60us()。 //延時(shí)60us _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 DQ=1。 _nop_()。 _nop_()。 } else //寫1 { DQ=0。 _nop_()。 _nop_()。 //延時(shí)2us DQ=1。 delay60us()。 //延時(shí)60us _nop_()。 _nop_()。 _nop_()。 _nop_()。 } mand=_cror_(mand,1)。 // 右移1位 } }/***************************************************************功能:讀ds18b20數(shù)據(jù) ****參數(shù):返回讀到的數(shù)據(jù) ***************************************************************/uchar ds18b20_readdata(void){ uchar readdata。 uchar i。 for(i=0。i8。i++) { DQ=0。 _nop_()。 _nop_()。 _nop_()。 DQ=1。 //釋放總線 //delay15us()。 注意不需要 if(DQ==0) //如果讀到的是0 { readdata=readdataamp。0x7f。 delay60us()。 } else //讀到的是1 { readdata=readdata|0x80。 delay60us()。 } if(i7) readdata=_cror_(readdata,1)。 } return readdata。}/***************************************************************功能:溫度處理函數(shù) *************************************************************/void temperature_process(uchar low,uchar high){ uint temp1,temp2,temp3。 if(highamp。0x80)//判斷正負(fù) { flag=1。 temp3=temp3|high。 temp3=temp3amp。0x00ff。 temp3=temp38。 temp1=temp3。 temp1=temp1|low。 temp1=(temp1^0xffff)。 temp1=temp1+1。 //取反加1 low=temp1amp。0x000f。 high=temp14。 process(high,low)。 } else { flag=0。 //zhen temp1=high。 temp2=low。 temp1=temp14。 temp2=temp24。 temp3=temp1|temp2。 high=temp3。 low=lowamp。0x0f。 process(high,low)。 }}/***************************************************************功能:數(shù)值處理函數(shù) *************************************************************/void process(unsigned char high,unsigned char low){ uint temp1。 uchar i。 temp1=low*625。 xiaoshu_temp[0]=temp1/1000+39。039。 //xiaoshu_temp[1]=temp1/100%10+39。039。 //xiaoshu_temp[2]=temp1%100/10+39。039。 //xiaoshu_temp[3]=temp1%10+39。039。 xiaoshu_temp[1]=39。\039。 dot_dis=1。 zhen_temp[0]=high/100+39。039。 zhen_temp[1]=high%100/10+39。039。 zhen_temp[2]=high%10+39。039。 zhen_temp[3]=39。\039。 for(i=0。i2。i++) if(zhen_temp[0]==39。039。) { zhen_temp[0]=zhen_temp[1]。 zhen_temp[1]=zhen_temp[2]。 zhen_temp[2]=39。\039。 } else break。}/****************************************///serial_set funcvoid serial_set(void){ SCON=0x50。 TMOD=TMODamp。0x0f。 TMOD=TMOD|0x20。 TH1=0xfd。 TL1=0xfd。 TR1=1。 TI=1。 //用PRINTF時(shí),TI要置1}/***************************************************************功能:讀序列號(hào)子程序 *************************************************************/uchar * read_rom(void){ uchar rom[8],i。 ds18b20_init()。 ds18b20_writemand(0x33)。 for(i=8。i0。i) { rom[i1]=ds18b20_readdata()。 } return amp。rom[0]。} /***************************************************************功能:序列號(hào)匹配子程序 *************************************************************/bit match_rom(uchar *rom){ uchar i。 ds18b20_init()。 ds18b20_writemand(0x55)。 for(i=8。i0。i) { ds18b20_writemand(*(rom+i1))。 // rom++。 } return 1。} “”include /***************************************************************功能: ****參數(shù):無(wú) ***************************************************************/void delay1_64ms(void){ uchar i。 for(i = 0。i i++) { _nop_()。 _nop_()。 _nop_()。 _nop_()。 }}/***************************************************************功能:延時(shí)40us ****參數(shù):無(wú) ***************************************************************//*void delay40us(void){ uchar i。 for(i = 0。i 20。i++) { 。 }}*//***************************************************************功能:判斷LCD忙 ****參數(shù):無(wú) ***************************************************************/unsigned char Lcd_Wait(void){ while(1) { DBPort=0xff。 LcdEn=0。 _nop_()。 LcdRs=0。 _nop_()。 _nop_()。 LcdRw=1。 _nop_()。 _nop_()。 LcdEn=1。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 if((DBPortamp。0x80)==0) { break。 } LcdEn=0。 } //delay40us()。 return DBPort。}/****************************************************************功能:寫LCD函數(shù) ****參數(shù):style為寫命令/數(shù)據(jù),0命令,1數(shù)據(jù);input為寫入的8位 **** 命令/數(shù)據(jù) ****************************************************************/void Lcd_Write(bit style,unsigned char input){ LcdEn=0。 _nop_()。 _nop_()。 LcdRs=style。 _nop_()。 _nop_()。 LcdRw=0。 DBPort=input。 _nop_()。 _nop_()。 LcdEn=1。 _nop_()。 _nop_()。 LcdEn=0。 _nop_()。 Lcd_Wait()。 }/******************************************************************功能:LCD清屏函數(shù) ****參數(shù):無(wú) **********************************
點(diǎn)擊復(fù)制文檔內(nèi)容
語(yǔ)文相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1