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

正文內(nèi)容

基于51單片機(jī)的溫度測試系統(tǒng)+有vb上位機(jī)-文庫吧

2024-10-21 16:09 本頁面


【正文】 respons()。 stop()。 } uchar read_add(uchar add)//指定地址讀數(shù)據(jù) { uchar temp。 start()。 write_byterom(0xa0)。 respons()。 write_byterom(add)。 respons()。 start()。 write_byterom(0xa1)。 respons()。 temp=read_byterom()。 stop()。 return temp。 } /*********************************************************************************************** ds18b20部分 **************************************************************************************************/ sbit DQ=P3^5。 void delay2(uchar i) { while(i)。 } void init_ds18b20()//初始化 ds18b20 { uchar i。 DQ=1。 delay2(8)。 DQ=0。 delay2(80)。 DQ=1。 while(DQ==1amp。amp。i255) i++。 delay2(35)。 delay2(20)。 } void write_byte(uchar dat)//向 ds18b20中寫一字節(jié) { uchar i。 for(i=0。i8。i++) { DQ=1。 delay2(1)。 DQ=0。 delay2(1)。 DQ=datamp。0x01。 delay2(5)。 DQ=1。 dat=1。 delay2(4)。 } } uchar read_byte()//從 ds18b20中 讀一字節(jié) { uchar i,dat=0。 for(i=0。i8。i++) { DQ=1。 delay2(1)。 DQ=0。 dat=1。 DQ=1。 if(DQ)dat=dat|0X80。 delay2(4)。 } return dat。 } uchar read_temp() //讀溫度函數(shù) { uchar a,b,c。 init_ds18b20()。 write_byte(0xcc)。 write_byte(0x44)。 init_ds18b20()。 write_byte(0xcc)。 write_byte(0xbe)。 a=read_byte()。 b=read_byte()。 c=(b4)|(a4)。 return c。 } uchar read_th()//讀上限函數(shù) { uchar a,b,c。 init_ds18b20()。 write_byte(0xcc)。 write_byte(0x44)。 init_ds18b20()。 write_byte(0xcc)。 write_byte(0xbe)。 a=read_byte()。 b=read_byte()。 c=read_byte()。 return c。 } uchar read_tl()//讀下限函數(shù) { uchar a,b,c。 init_ds18b20()。 write_byte(0xcc)。 write_byte(0x44)。 init_ds18b20()。 write_byte(0xcc)。 write_byte(0xbe)。 a=read_byte()。 b=read_byte()。 a=read_byte()。 c=read_byte()。 return c。 } /*********************************************************************************************** 鍵盤部分( P2^0~P2^3) **************************************************************************************************/ void keyscan() { uchar temp,num1,num2。 temp=P2。 tempamp。=0x0f。 if(temp!=0x0f) //消抖 { delay(5)。 if(temp!=0x0f) { temp=P2。 tempamp。=0x0f。 if(temp==0x0e) { num1=1。 write_ds(0x8e,0x00)。 write_ds(0x80,s|0x80)。//禁止寫保護(hù) while(temp==0x0e)//松手檢測 { temp=P2。 tempamp。=0x0f。 } while(1) { temp=P2。 tempamp。=0x0f。 if(temp==0x0e) { delay(5)。 temp=P2。 tempamp。=0x0f。 if(temp==0x0e) { num1++。 } } while(temp==0x0e)//松手檢測 { temp=P2。 tempamp。=0x0f。 } if(num1==1) { write_(0x80+0x40+0x08)。 write_(0x0f)。//光標(biāo)閃爍 temp=P2。 tempamp。=0x0f。 if(temp==0x0d) { delay(5)。 if(temp==0x0d) { while(temp==0x0d)//松手檢測 { temp=P2。 tempamp。=0x0f。 } s=read_ds(0x81)。 s1=s/16。 s2=s%16。 s2+=1。 if(s2==10) { s2=0。 s1+=1。 } if(s1==6) s1=0。 write_(0x80+0x40+0x07)。 write_date(table2[s1])。 write_date(table2[s2])。 write_ds(0x80,s1*16+s2)。//向 ds1302中寫入秒 } } else if(temp==0x0b) { delay(5)。 if(temp==0x0b) { while(temp==0x0b)//松手檢測 { temp=P2。 tempamp。=0x0f。 } s=read_ds(0x81)。//讀 ds1302秒 s1=s/16。 s2=s%16。 s2=1。 if(s2==1) { s2=9。 s1=1。 } if(s1==1) s1=5。 write_(0x80+0x40+0x07)。 write_date(table2[s1])。 write_date(table2[s2])。 write_ds(0x80,s1*16+s2)。 } } } if(num1==2) { write_(0x80+0x40+0x05)。 write_(0x0f)。 temp=P2。 tempamp。=0x0f。 if(temp==0x0d) { delay(5)。 if(temp==0x0d) { while(temp==0x0d)//松手檢測 { temp=P2。 tempamp。=0x0f。 } m=read_ds(0x83)。//從 ds1302中讀分 m1=m/16。 m2=m%16。 m2+=1。 if(m2==10) { m2=0。 m1+=1。 } if(m1==6) m1=0。 write_(0x80+0x40+0x04)。 write_date(table2[m1])。 write_date(table2[m2])。 write_ds(0x82,m1*16+m2)。//向 ds1302中寫入分 } } else if(temp==0x0b) { delay(5)。 if(temp==0x0b) { while(temp==0x0b)//松手檢測 { temp=P2。 tempamp。=0x0f。 } m=read_ds(0x83)。 m1=m/16。 m2=m%16。 m2=1。 if(m2==1) { m2=9。 m1=1。 } if(m1==1) m1=5。 write_(0x80+0x40+0x04)。 write_date(table2[m1])。 write_date(table2[m2])。 write_ds(0x82,m1*16+m2)。 } } } if(num1==3) { write_(0x80+0x40+0x02)。 write_(0x0f)。 temp=P2。 tempamp。=0x0f。 if(temp==0x0d) { delay(5)。 if(temp==0x0d) { while(temp==0x0d)//松手檢測 { temp=P2。 tempamp。=0x0f。 } h=read_ds(0x85)。//從 ds1302中讀時 h1=h/16。 h2=h%16。 h2+=1。 if(h2==10) { h2=0。 h1+=1。 }
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1