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

正文內(nèi)容

畢業(yè)設(shè)計-基于51的溫度報警器設(shè)計-(參考版)

2024-12-06 17:30本頁面
  

【正文】 //蜂鳴器報警 } } } 。 //若在設(shè)定范圍內(nèi),則液晶顯示當(dāng)前溫度值 P07=1; //關(guān)閉蜂鳴器 } 29 else { lcd_display()。 //調(diào)用溫度上下限設(shè)定函數(shù)設(shè)定溫度上下限 DS18B20_temp()。 lcd_init()。 //將這三個引腳設(shè)為輸出 P04=0。 //獲得個位以上數(shù)值 a[0]=te%10。 //獲得整數(shù)部分的數(shù)值 a[1]=te%10。 //計算溫度值 a[2]=TEMP_Result%10。 //讀出 MS DS18B20_init()。 //讀暫存器 temp_low=read_byte()。 //等待轉(zhuǎn)換 while(!DS18B20_init()) //等待 DS18B20 復(fù)位 {} write_byte(0xCC)。 //總線上只有一個 DS18B20,因此可直接跳過尋址 write_byte(0x44)。 } return(ans)。 //ans 右移 一位 if(DS18B20_r()) ans|=0x80。i8。 } } uchar read_byte() { unsigned char ans=0。 //byte 最后一位為 1,這寫 1 時隙;若為 0,則寫 0時 byte=byte1。i++) { DS18B20_w(byteamp。 } void write_byte(unsigned char byte) { for(i=0。 27 delay_us(60)。 delay_us(80)。 //延時小于 15us if(P06==1) date=1。 //延時大于 1us DS_H。 //主器件拉低開始 DS_0。 //大于 1us 延時即可 } uchar DS18B20_r(void) { char date。 //寫時隙必須至少持續(xù) 60μ s DS_H。 //主器件拉低,寫 0 DS_0。 //最少延時 1us if(date) DS_H。 //主器件拉低開始 DS_0。 //最小 480us return(t)。 //判斷存在脈沖, DS18B20 是否拉低 else t=0。 //電阻上拉 delay_us(60)。 //主器件拉低 delay_us(500)。 DS_L。//_nop_()。 delay_us(50)。 } int DS18B20_init(void) { int t。//顯示溫度十分位數(shù)值 write_date(0xA1)。//顯示溫 度個位數(shù)值 write_date(0x2e)。 //設(shè)定溫度值顯示的位置 write_date(0x30+a[0])。num++) //在第一行顯示漢字“溫度顯示” { write_date(table[num])。 //將第一行顯示位置設(shè)為第 3 個漢字位 for(num=0。 //設(shè)定光標(biāo)右移,整屏不移動 25 write_(0x02)。 //基本指令集動作 write_(0x0c)。 } void lcd_init()//液晶初始化子函數(shù) { write_(0x01)。0x0f)4)。0xf0)。 Sendbyte(0xfa)。//低四位放在第二個字節(jié)的高四位 rs_0。//取高四位,數(shù)據(jù)分兩次傳送 //每字節(jié)的內(nèi)容被送入兩個字節(jié) //高四位放在第一個字節(jié)的高四位 Sendbyte((amp。 Sendbyte(amp。//左移一位 } } void write_(uchar )//寫指令子函數(shù) { rs_1。 en_1。0x80)//如果最高位數(shù)據(jù)被發(fā)送 24 rw_1。i++) { en_0。 } } void Sendbyte(uchar dat)//串行發(fā)送數(shù)據(jù)子函數(shù) { for(i=0。 delay_us(5000)。i++) { keyscan()。 } if(key=11)//如果鍵值為 11,開始設(shè)定溫度上 限 { for(i=0。 } l=100*b[0]+10*b[1]+ b[2]。 b[i]=key。i3。//將鍵值返回至鍵盤掃描函數(shù)調(diào)用處 } 23 void area()//溫度上下限設(shè)定函數(shù) ,程序設(shè)定溫度上下限最大范圍為 到 { keyscan()。0xf0。 } while(temp!=0xf0) { temp=P1。 case 0x77: key=15。 case 0xb7: key=14。 case 0xd7: key=13。 switch(temp) { case 0xe7: key=12。0xf0。 temp=P1。0xf0。 temp=P1。0xf0。 } while(temp!=0xf0) { temp=P1。 case 0x7b: key=11。 case 0xbb: key=10。 case 0xdb: key=0。 switch(temp) { case 0xeb: key=9。0xf0。 temp=P1。0xf0。 temp=P1。0xf0。 } while(temp!=0xf0) { temp=P1。 case 0x7d: key=8。 case 0xbd: key=7。 case 0xdd: key=6。 switch(temp) { case 0xed: key=5。0xf0。 temp=P1。0xf0。 temp=P1。0xf0。 } while(temp!=0xf0) //松手檢測 { temp=P1。 case 0x7e: key=4。 case 0xbe: key=3。 case 0xde: key=2。 //讀取 P1 口電平 switch(temp) //switch 語句獲取鍵值 { case 0xee: key=1。0xf0。 //延時 5ms 消抖 temp=P1。0xf0。 //將第一行設(shè)為低電平,掃描第一行 temp=P1。i++) _nop_()。 void delay_us(uint x)
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1