【文章內(nèi)容簡(jiǎn)介】
*/ /******************************************************************/ unsigned char ReadOneChar(void) { unsigned char i=0。 unsigned char dat = 0。 for (i=8。i0。i) { DQ = 0。 // 給脈沖信號(hào) dat=1。 DQ = 1。 // 給脈沖信號(hào) if(DQ) dat|=0x80。 delay(5)。 } return(dat)。 } /******************************************************************/ /* 寫(xiě)一個(gè)字節(jié) */ /******************************************************************/ void WriteOneChar(unsigned char dat) { unsigned char i=0。 for (i=8。 i0。 i) { DQ = 0。 DQ = datamp。0x01。 delay(5)。 DQ = 1。 dat=1。 } delay(5)。 } /******************************************************************/ /* 讀取溫度 */ /******************************************************************/ unsigned int ReadTemperature(void) { unsigned char a=0。 unsigned int b=0。 unsigned int t=0。 Init_DS18B20()。 WriteOneChar(0xCC)。 // 跳過(guò)讀序號(hào)列號(hào)的操作 WriteOneChar(0x44)。 // 啟動(dòng)溫度轉(zhuǎn)換 delay(200)。 Init_DS18B20()。 WriteOneChar(0xCC)。 //跳過(guò)讀序號(hào)列號(hào)的 操作 WriteOneChar(0xBE)。 //讀取溫度寄存器等 ( 共可讀 9個(gè)寄存器 ) 前兩個(gè)就是溫度 a=ReadOneChar()。 //低位 b=ReadOneChar()。 //高位 b=8。 t=a+b。 return(t)。 } void function(void) { switch(kt) { case 0:break。//無(wú)操作 case 1:feige1=1。fc++。if(fc=4){fc=0。feige1=0。}。kt=0。break。//功能選著 1小時(shí) 2分 3秒 case 2: if(fc==1)hours++。//加時(shí)間 if(fc==2)minute++。 if(fc==3)second++。 if(hours=24)hours=0。 if(minute=60)minute=0。 if(second=60)second=0。 kt=0。 break。 case 3: if(fc==1)hours。//減時(shí)間 if(fc==2)minute。 if(fc==3)second。 if(hours=0)hours=24。 if(minute=0)minute=60。 if(second=0)second=60。 kt=0。break。 } } void scankey(void) { if(!key1) { delay(1000)。 if(!key1){kt=1。while(!key1)。} } if(!key2) { delay(1000)。 if(!key2){kt=2。while(!key2)。} } if(!key3) { delay(1000)。 if(!key3){kt=3。while(!key3)。} } } 9 結(jié)論與心得 這次課程綜合設(shè)計(jì),在編程和仿真方面花了很久時(shí)間。一開(kāi)始,按照時(shí)序圖將讀寫(xiě)函數(shù)寫(xiě)好后,會(huì)顯示秒部分,并準(zhǔn)時(shí)走,但液晶屏不穩(wěn) 定,有一些亂碼和光標(biāo)亂閃。經(jīng)檢查發(fā)現(xiàn)有些發(fā)生地址重疊的沖突,寫(xiě)按鍵部分程序是發(fā) 現(xiàn)調(diào)節(jié)好后在最后刷新屏幕時(shí)調(diào)節(jié)好的時(shí)間沒(méi)有讀取到,不斷調(diào)節(jié)程序, 然后仿真,最終發(fā)現(xiàn)時(shí)沒(méi)有將調(diào)節(jié)好的時(shí)間讀取到寄存器中。 加上溫度傳感器部分后發(fā) 現(xiàn)在調(diào)節(jié)時(shí)間時(shí)出現(xiàn)亂碼和不穩(wěn)定現(xiàn)象,光標(biāo)亂跳的現(xiàn)象。經(jīng)過(guò)不斷檢查,發(fā)現(xiàn)在按鍵調(diào)節(jié)時(shí)軟件讀取溫度值的標(biāo)志位是允許的, 也就是說(shuō)它在調(diào)節(jié)時(shí)間時(shí)又在動(dòng)態(tài)顯示周?chē)? 環(huán)境中的溫度值,這樣會(huì)導(dǎo)致光標(biāo)不穩(wěn)定的現(xiàn)象。最終這個(gè)問(wèn)題得到很好的解決。 焊接是兩人合作完成的,也發(fā)現(xiàn)了許多小問(wèn)題。細(xì)節(jié)方面也沒(méi)有注意到位。在最小系統(tǒng)焊好后沒(méi)有及時(shí)的檢查是否錯(cuò)誤,導(dǎo)致最后焊完后連接電源發(fā)現(xiàn)無(wú)法顯示。對(duì)檢查電路造成了很大麻煩。良好的焊接習(xí)慣很重要。 以上就是本次課程設(shè)計(jì)的心得體會(huì)。 參考文獻(xiàn) [1] 王兆安、劉進(jìn)軍.《電力電子技術(shù)(第五版)》.機(jī)械工業(yè)出版社. . [2] 鄒應(yīng)全.《 51系列單片機(jī)原理與實(shí)驗(yàn)教程》.西安電子科技大學(xué)出版社. 2021. [3] 郭天祥 .《 61單片機(jī) C語(yǔ)言教程》.電子工業(yè)出版社. 2021. [4]潘新民、王艷芳.《微型計(jì)算機(jī)控制技術(shù)使用教程》.電子工業(yè)出版社 .. g an employment tribunal clai Employment tribunals sort out disagreements between employers and employees. You may need to make a claim to an employment tribunal if: ? you don39。t agree with the disciplinary action your employer has taken against you ? your employer dismisses you and you think that you have been dismissed unfairly. For more information about dismissal and unfair dismissal, see Dismissal. You can make a claim to an employment tribunal, even if you haven39。t appealed against the disciplinary action your employer has taken against you. However, if you win your case, the tribunal may reduce any pensation awarded to you as a result of your failure to appeal. Remember that in most cases you must make an application to an employment t