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

正文內(nèi)容

基于單片機(jī)的溫控報警器設(shè)計-免費閱讀

2025-07-09 05:13 上一頁面

下一頁面
  

【正文】 //拉低 PB3 電平 delay_10us(75)。 } while(i) { NOP()。 //設(shè)置 lcd 顯示位置是第一行,第14 個位 delay_ms(5)。 //設(shè)置 lcd 顯示位置是第一行,第12 個位 delay_ms(5)。 //實時溫度顯示子函數(shù) delay_us(100)。 //第二行要顯示的初始內(nèi)容 delay_ms(5)。 //8 位數(shù)據(jù)傳輸, 2行顯示, 5*7 字形,檢測忙信號 lcd_w_(0x08,1)。 lcd_en_0。 //檢測 lcd 是否處于忙狀態(tài) lcd_rs_1。 //拉低 rw 電平 _NOP()。 val=PINC。 dataport=0xff。 if((y == 0) amp。 //y 軸為 1時,加十六位的 40 } temp|=0x80|posx。 DDRB|=(14)。j(uint)(xtal*1432)。 void ss(void)。 void locate(char posx,char posy)。 //全局變量,設(shè)定溫度總變量,初始值為 50 int xs=0,ge=0,shi=5,bai=0,sw=0。(1PB3)) //設(shè)置讀 PB3 define con (PINBamp。想要延遲過快或延緩?fù)怼? 液晶顯示器 顯示位置的調(diào)試。 不可接反 或 虛焊多焊 。 //點亮 led 燈 } if(ttemperture) //當(dāng)實時溫度比設(shè)定溫度低 { led_off。 //關(guān) led 燈 bell_off。(sw==4)) ////當(dāng)減 1 鍵按下并且轉(zhuǎn)換位變量 sw等于 4,百位減法變化 { delay_ms(100)。 if(shi0) { shi=9。amp。 ge++。 26 } } if((reduce==0)amp。 程序代碼如下: void sa(void) { if(con==0) //當(dāng)轉(zhuǎn)換位鍵按下 { delay_ms(100)。 //拉高 en 電平 _NOP()。 lcd1602 的成在寫入數(shù)據(jù)的狀態(tài),將準(zhǔn)備寫入的數(shù)據(jù)分 配給 PC 口,延遲等待寫數(shù)據(jù),然后連接到一個下降沿完整的 lcd1602 的數(shù)據(jù)被寫入。 //空命令,用于延時 dataport=w_data。 display_str(0,0,realtime T:)。 lcd_w_(0x38,0)。進(jìn)入循環(huán)語句之后,首先要將變量右移一位,這里值得注意的是這個變量不需要給一個它初始值,因為無論初始值是什么并不影響數(shù)據(jù)的讀出。NOP()。i8。 //延時 這個是單片機(jī)向傳感器寫命 令的函數(shù)。 //拉低 PB3 電平 NOP()。接著發(fā)出轉(zhuǎn)換命令之后,再次初始化傳感器,再發(fā)出讀溫度命令 0xbe。 //讀取到溫度的前兩個字節(jié) temp2=read_18b20_byte()。 int temp。 //延時 DQ_CLR。如下圖 11 是蜂鳴器部分, 1 腳接單片機(jī)的 PD4 端口, 2 腳接電源地, 這里用單片機(jī)高電平驅(qū)動蜂鳴器的方法。用一個 100u 和一個 的電容接電源和電源正極 。 1腳是電源地 GND; 2腳接電源正極 VCC;3 腳接液晶顯示偏壓信號,利用兩個 1k 的電阻進(jìn)行分壓; 4腳到 6腳接單片機(jī) ATmega16的 PD5 到 PD7,分別代表接到 LCD1602 的 RS、 RW、 EN 的引腳; 7 腳到 14 腳接按順序接到單片機(jī) ATmega16 的 PB0 到 PB7引腳, 15 腳背光源正極接電源正極 VCC; 16 腳背光源負(fù)極接正源地 GND。 1 腳接電源 VCC, 2 腳是數(shù)據(jù)總線的引腳用于接到單片機(jī) ATmega16 的 PB3 引腳, 3 腳用于接地 GND。 LCD1602的指令說明及時序 基本操作時序 :輸入: RS=L,RW=H,E=H 輸出: D0~D7=狀態(tài)字 :輸入: RS=L,R/W=L,D0~D7=指令碼 ,E=高脈沖 輸出:無 13 :輸入: RS=H,R/W=H,E=H 輸出: =數(shù)據(jù) :輸入: RS=H,R/W=L,D0~D7=數(shù)據(jù) ,E=高脈 沖 輸出:無 單片機(jī)介紹 這次的設(shè)計,要用到的是單片機(jī) ATmega16。 第 3 腳: VL 為液晶顯示器對比度調(diào)整端,接正電源時對比度最弱,接地時對比度最高,對比度過高時會產(chǎn)生 “鬼影”,使用時可以通過一個 10K 的電位器調(diào)整對比度。 ( 4)延時 3微秒。 ( 3) 按從低位到高位的順序發(fā)送字節(jié)(一次只發(fā)送一位)。 ( 4) 延時 750 微秒(該時間的 時間范圍可以從 480 到 960 微秒)。 其引腳功能描述見下: 1. GND 地信號 2. DQ:數(shù)據(jù)輸入 /輸出引腳。例如傳感器的溫度為 100176。便于單片機(jī)處理及控制,省去傳統(tǒng)的測溫方法的很多外圍電路。 8 擬解決的主要問題 擬解決的問題: 1. 確定采用哪種傳感器進(jìn)行設(shè)計。它 采用溫度敏感元件也就是溫度傳感器(如鉑電阻,熱電偶,半導(dǎo)體,熱敏電阻等),將溫度的變化轉(zhuǎn)換成電信號的變化,如電壓和電流的變化,溫度變化和電信號的變化有一定的關(guān)系,如線性關(guān)系,一定的曲線關(guān)系等,這個電信號可以使用模數(shù)轉(zhuǎn)換的電路即 AD 轉(zhuǎn)換電路將模擬信號轉(zhuǎn)換為數(shù)字信 號,數(shù)字信號再送給處理單元,如單片機(jī)或者 PC 機(jī)等,處理單元經(jīng)過內(nèi)部的軟件計算將這個數(shù)字信號和溫度聯(lián)系起來,成為可以顯示出來的溫度數(shù)值,如 攝氏度,然后通過顯示單元,如 LED, ,LCD 或者電腦屏幕等顯示出來給人觀察。往往會超過或低于允許值,致使大批良種的報廢,耽誤農(nóng)時,影響生產(chǎn) 。溫度的測量不僅僅局限于外出穿衣的指標(biāo)上了,在現(xiàn)實的社會中,溫度的測量和控制無處不在,例如家庭里面都能看見的冰箱的自動溫度調(diào)節(jié)。 所以,溫度的測量是一個很重要的物理參數(shù),它能直接告訴人們所需要的溫度的大小。 關(guān)鍵詞: DS18B20, lCD1602, 單片機(jī), 聲光報警 3 Temperature alarm design based on SCM Abstract: The temperature is realtime access to the physical quantities in our daily production and life, but it can not see, just by feeling it probably only feel the temperature values, traditional pointer thermometer indicates that the temperature, but low accuracy, use is not convenient enough, the display is not intuitive, digital thermometer is made using digital more intuitive understanding of the temperature in the end they want to know is how much. Therefore, the temperature measurement is a very important physical parameters can directly tell people the size of the required temperature. With the development of science and technology of the world, for the temperature measurement requirements bee increasingly stringent, measure the temperature of the environment is also worsening. Temperature measurement is not limited to the indicators go out dressed in the reality of the society, the measurement and control of temperature everywhere, for example, the family can see inside the refrigerator thermostat. But many times, in the harsh environment of the measurement will be subject to a large degree of restriction, especially in industrial control, at this time, the automatic control of the temperature measuremente particularly important. This article is DS18B20 as the temperature sensor and the use of automatic measurement of the current temperature, to be processed by the microcontroller avr mega16 control displays the set temperature and the current temperature and through lCD1602 to, if the temperature exceeds the set temperature, the system will be relatively simple the sound and light alarm. Keywords: SCM, DS18B20, lCD1602, sound and light alarm 4 目 錄 1 緒論 .............................................................................................................. 6 課題的背景 ....................................................................................... 6 課題的意義 ....................................................................................... 6 研究的基本內(nèi)容與擬解決的主要問題 ........................................... 7 研究的基本內(nèi)容 ......................................................................... 7 擬解決的主要問題 ..................................................................... 8 2 設(shè)計的思路 .................................................................................................. 8 設(shè)計基本原理 ................................................................................... 8 設(shè)計的基本條件 ............................................................................... 9 溫度報警器的技術(shù)和工作原理 ....................................................... 9 DS18B20 溫度傳感器介紹 ......................................................... 9 DS18B20 的初始化 ................................................................... 10 DS18B20 的寫操作 ................................................................... 10 DS18B20 的讀操作 ................................................................... 11 DS1
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1