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

正文內(nèi)容

溫控定時(shí)器烤火爐的設(shè)計(jì)畢業(yè)論文-資料下載頁(yè)

2025-06-28 20:54本頁(yè)面
  

【正文】 時(shí)序 Lcd1602_Delay1ms(5)。 LCD1602_E = 0。 LCD1602_DATAPINS = dat 4。 //寫入低四位 Lcd1602_Delay1ms(1)。 LCD1602_E = 1。 //寫入時(shí)序 Lcd1602_Delay1ms(5)。 LCD1602_E = 0。}endif/******************************************************************************** 函 數(shù) 名 : LcdInit()* 函數(shù)功能 : 初始化LCD屏* 輸 入 : 無(wú)* 輸 出 : 無(wú)*******************************************************************************/ ifndef LCD1602_4PINSvoid LcdInit() //LCD初始化子程序{ LcdWriteCom(0x38)。 //開顯示 LcdWriteCom(0x0c)。 //開顯示不顯示光標(biāo) LcdWriteCom(0x06)。 //寫一個(gè)指針加1 LcdWriteCom(0x01)。 //清屏 LcdWriteCom(0x80)。 //設(shè)置數(shù)據(jù)指針起點(diǎn)}elsevoid LcdInit() //LCD初始化子程序{ LcdWriteCom(0x32)。 //將8位總線轉(zhuǎn)為4位總線 LcdWriteCom(0x28)。 //在四位線下的初始化 LcdWriteCom(0x0c)。 //開顯示不顯示光標(biāo) LcdWriteCom(0x06)。 //寫一個(gè)指針加1 LcdWriteCom(0x01)。 //清屏 LcdWriteCom(0x80)。 //設(shè)置數(shù)據(jù)指針起點(diǎn)}endif環(huán)境溫度采集函數(shù):include/******************************************************************************** 函數(shù)名 : Delay1ms* 函數(shù)功能 : 延時(shí)函數(shù)* 輸入 : 無(wú)* 輸出 : 無(wú)*******************************************************************************/void Delay1ms(unsigned int y){ unsigned int x。 for(y。y0。y) for(x=110。x0。x)。}/*************************************************************************** 函數(shù)名 : Ds18b20Init* 函數(shù)功能 : 初始化* 輸入 : 無(wú)* 輸出 : 初始化成功返回1,失敗返回0**************************************************************************/unsigned char Ds18b20Init(){ unsigned int i。 DSPORT=0。 //將總線拉低480us~960us i=70。 while(i)。//延時(shí)642us DSPORT=1。//然后拉高總線,如果DS18B20做出反應(yīng)會(huì)將在15us~60us后總線拉低 i=0。 while(DSPORT) //等待DS18B20拉低總線 { i++。 if(i5000)//等待5MS return 0。//初始化失敗 } return 1。//初始化成功}/*************************************************************************** 函數(shù)名 : Ds18b20WriteByte* 函數(shù)功能 : 向18B20寫入一個(gè)字節(jié)* 輸入 : * 輸出 : 無(wú)**************************************************************************/void Ds18b20WriteByte(unsigned char dat){ unsigned int i,j。 for(j=0。j8。j++) { DSPORT=0。 //每寫入一位數(shù)據(jù)之前先把總線拉低1us i++。 DSPORT=datamp。0x01。 //然后寫入一個(gè)數(shù)據(jù),從最低位開始 i=6。 while(i)。 //延時(shí)68us,持續(xù)時(shí)間最少60us DSPORT=1。 //然后釋放總線,至少1us給總線恢復(fù)時(shí)間才能接著寫入第二個(gè)數(shù)值 dat=1。 }}/*************************************************************************** 函數(shù)名 : Ds18b20ReadByte* 函數(shù)功能 : 讀取一個(gè)字節(jié)* 輸入 : * 輸出 : 無(wú)**************************************************************************/unsigned char Ds18b20ReadByte(){ unsigned char byte,bi。 unsigned int i,j。 for(j=8。j0。j) { DSPORT=0。//先將總線拉低1us i++。 DSPORT=1。//然后釋放總線 i++。 i++。//延時(shí)6us等待數(shù)據(jù)穩(wěn)定 bi=DSPORT。 //讀取數(shù)據(jù),從最低位開始讀取 byte=(byte1)|(bi7)。 i=4。 //讀取完之后等待48us再接著讀取下一個(gè)數(shù) while(i)。 } return byte。}/*************************************************************************** 函數(shù)名 : Ds18b20ChangTemp* 函數(shù)功能 : 讓18b20開始轉(zhuǎn)換溫度* 輸入 : * 輸出 : 無(wú)**************************************************************************/void Ds18b20ChangTemp(){ Ds18b20Init()。 Delay1ms(1)。 Ds18b20WriteByte(0xcc)。 //跳過(guò)ROM操作命令 Ds18b20WriteByte(0x44)。 //溫度轉(zhuǎn)換命令}/*************************************************************************** 函數(shù)名 : Ds18b20ReadTempCom* 函數(shù)功能 : 發(fā)送讀取溫度命令* 輸入 : * 輸出 : 無(wú)**************************************************************************/void Ds18b20ReadTempCom(){ Ds18b20Init()。 Delay1ms(1)。 Ds18b20WriteByte(0xcc)。 //跳過(guò)ROM操作命令 Ds18b20WriteByte(0xbe)。 //發(fā)送讀取溫度命令}/*************************************************************************** 函數(shù)名 : Ds18b20ReadTemp* 函數(shù)功能 : 讀取溫度* 輸入 : * 輸出 : 無(wú)**************************************************************************/int Ds18b20ReadTemp(){ int temp=0。 unsigned char tmh,tml。 Ds18b20ChangTemp()。 //先寫入轉(zhuǎn)換命令 Ds18b20ReadTempCom()。 //然后等待轉(zhuǎn)換完后發(fā)送讀取溫度命令 tml=Ds18b20ReadByte()。 //讀取溫度值共16位,先讀低字節(jié) tmh=Ds18b20ReadByte()。 //再讀高字節(jié) temp=tmh。 temp=8。 temp|=tml。 return temp。}
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1