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

正文內(nèi)容

精品--多點式單總線數(shù)字溫度監(jiān)測系統(tǒng)設計(完整程序)-資料下載頁

2024-12-06 03:26本頁面

【導讀】示、報警等功能。它以AT89C51單片機為主控制芯片,采用數(shù)字溫度傳感器。DS18B20實現(xiàn)多路溫度的檢測,測量精度可以達到℃。液晶顯示模塊,LCD1602A作為顯示器,形象直觀的顯示測出的溫度值。先在緒論中介紹了此系統(tǒng)的背景以及功能。第二章確定設計方案。計、硬件設計框圖及所使用的各種芯片功能與特性。第四章重點剖析了軟件設計。最后一章中具體論述了系統(tǒng)的調(diào)試軟件及調(diào)試中出現(xiàn)的問題。讀數(shù)方便、精度高、測溫范圍廣等特點,在實際工程中得到廣泛應用。

  

【正文】 char *rom)。 endif 主 函數(shù) 程序 : include include include include include include unsigned char temp[5]。 extern char xiaoshu_temp[5],zhen_temp[4]。 extern bit flag。 extern bit dot_dis。 uchar ds18b20_num1[8]={0xfd,0x00,0x00,0x00,0xb8,0xc5,0x45,0x28}。 uchar ds18b20_num2[8]={0x8e,0x00,0x00,0x00,0xb8,0xc5,0x30,0x28}。 uchar ds18b20_num3[8]={0xb9,0x00,0x00,0x00,0xb8,0xc5,0x31,0x28}。 uchar ds18b20_num4[8]={0xe0,0x00,0x00,0x00,0xb8,0xc5,0x32,0x28}。 define uchar unsigned char define uint unsigned int void serial_set(void)。 void process(unsigned char,unsigned char)。 char volatile xiaoshu_temp[5],zhen_temp[4]。 // bit flag。 bit dot_dis=1。 sbit DQ=P1^0。 //sbit DQ=P2^3。 extern unsigned char temp[5]。 void delay(unsigned int time) { unsigned int i,j。 7 for(i=0。itime。i++) for(j=0。j200。j++)。 } void main(void) { uchar i。 uchar *ds18b20_rom。 char *str1=1:。 char *str2=2:。 char *str3=3:。 char *str4=4:。 serial_set()。 Lcd_Init()。 ClrScreen()。 GotoXY(0,0)。 dot_dis=1。 /*ds18b20_rom=read_rom()。 //讀序列號 for(i=0。i8。i++) { ds18b20_num2[i]=*ds18b20_rom。 ds18b20_rom++。 } GotoXY(0,1)。 for(i=0。i8。i++) //顯示序列號 { print_char(ds18b20_num2[i]/16)。 print_char(ds18b20_num2[i]%16)。 } while(1)。*/ while(1) { ds18b20_init()。 ds18b20_writemand(0xcc)。 ds18b20_writemand(0x44)。 //轉(zhuǎn)換 8 delay(500)。 match_rom(ds18b20_num1)。 //匹配第一路 ds18b20_writemand(0xbe)。 //讀 for(i=0。i2。i++) { temp[i]=ds18b20_readdata()。 } temperature_process(temp[0],temp[1])。 Screen_home()。 Print(str1)。 if(!flag) //正 { Print(zhen_temp)。 if(dot_dis) Print(.)。 Print(xiaoshu_temp)。 } else //負 { Print()。 Print(zhen_temp)。 if(dot_dis) Print(.)。 Print(xiaoshu_temp)。 } Print( )。 ds18b20_init()。 ds18b20_writemand(0xcc)。 ds18b20_writemand(0x44)。 //轉(zhuǎn)換 delay(500)。 match_rom(ds18b20_num2)。 //匹配第二路 ds18b20_writemand(0xbe)。 //讀 for(i=0。i2。i++) { 9 temp[i]=ds18b20_readdata()。 } temperature_process(temp[0],temp[1])。 GotoXY(9,0)。 Print(str2)。 if(!flag) //正 { Print(zhen_temp)。 if(dot_dis) Print(.)。 Print(xiaoshu_temp)。 } else //負 { Print()。 Print(zhen_temp)。 if(dot_dis) Print(.)。 Print(xiaoshu_temp)。 } Print( )。 ds18b20_init()。 ds18b20_writemand(0xcc)。 ds18b20_writemand(0x44)。 //轉(zhuǎn)換 delay(500)。 match_rom(ds18b20_num3)。 //匹配第三路 ds18b20_writemand(0xbe)。 //讀 for(i=0。i2。i++) { temp[i]=ds18b20_readdata()。 } temperature_process(temp[0],temp[1])。 GotoXY(0,1)。 Print(str3)。 10 if(!flag) //正 { Print(zhen_temp)。 if(dot_dis) Print(.)。 Print(xiaoshu_temp)。 } else //負 { Print()。 Print(zhen_temp)。 if(dot_dis) Print(.)。 Print(xiaoshu_temp)。 } Print( )。 ds18b20_init()。 ds18b20_writemand(0xcc)。 ds18b20_writemand(0x44)。 //轉(zhuǎn)換 delay(500)。 match_rom(ds18b20_num4)。 //匹配第 四 路 ds18b20_writemand(0xbe)。 //讀 for(i=0。i2。i++) { temp[i]=ds18b20_readdata()。 } temperature_process(temp[0],temp[1])。 GotoXY(9,1)。 Print(str4)。 if(!flag) //正 { Print(zhen_temp)。 if(dot_dis) Print(.)。 11 Print(xiaoshu_temp)。 } else //負 { Print()。 Print(zhen_temp)。 if(dot_dis) Print(.)。 Print(xiaoshu_temp)。 } Print( )。 //delay(100)。 } while(1)。 } void delay1_64ms(void) { uchar i。 for(i = 0。i i++) { _nop_()。 _nop_()。 _nop_()。 _nop_()。 } } /******功能 : 延時 40us**參數(shù) : 無 ****/ /*void delay40us(void) { uchar i。 for(i = 0。i 20。i++) { 。 12 } }*/ /******功能 : 判斷 LCD 忙 ****參數(shù) : 無 ****/ 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) { 13 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ù) : 無 *******/ void ClrScreen(void) { Lcd_Write(Lcd_Command,Lcd_Clear_Screen)。 //delay1_64ms()。 } /*********功能: LCD 歸位函數(shù) **參數(shù):無 *******/ void Screen_home(void) { Lcd_Write(Lcd_Command,Lcd_Home)。 //delay1_64ms()。 } /********功能:設置顯示模式 **參數(shù): ******/ void Lcd_SetDisplay(unsigned char DisplayMode) { Lcd_Write(Lcd_Command,0x08|DisplayMode)。 } 14 /********功能: LCD 移動設置 **參數(shù):取值如下 ******/ void Lcd_Move(unsigned char MoveMode) { Lcd_Write(Lcd_Command,0x10|MoveMode)。 } /*********功 能: LCD 輸入設置 **參數(shù):取值如下 *******/ void Lcd_SetInput(unsigned char InputMode) { Lcd_Write(Lcd_Command,0x04|InputMode)。 } /*********功能: LCD 初始化 **參數(shù):取值如下 *******/ void Lcd_Init(void) { Lcd_Write(Lcd_Command,0x38)。 //8 位數(shù)據(jù)端口 ,2 行顯示 ,5*7 點陣 Lcd_SetDisplay(Lcd_Display_On)。 // 開 啟 顯 示 , 無光標|Lcd_Cursor|Lcd_Flash //Lcd_Move(Lcd_CursorMove|Lcd_Left)。 Lcd_SetInput(Lcd_Ac_Up|Lcd_No_Move)。 //AC 遞增 , 畫面不動 _To } /*********功能:顯示位置設置 **參數(shù): x行; y列 *******/ void GotoXY(unsigned char x,unsigned char y) { if(y==0) {Lcd_Write(Lcd_Command,0x80|x)。 } if(y==1) {Lcd_Write(Lcd_Command,0x80|(x+0x40))。 } } /********功能: LCD 顯示函數(shù)
點擊復制文檔內(nèi)容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1