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

正文內(nèi)容

報(bào)告基于溫度采集無線監(jiān)測系統(tǒng)論文(編輯修改稿)

2024-09-10 11:24 本頁面
 

【文章內(nèi)容簡介】 r c){ d1=0x00。 d2=0x00。 d3=0x00。 po1=0x00。 po2=0x00。 po3=0x00。 po4=0x00。 d3=(c%1000)/100。 //取百位 d2=(c%100)/10。 //取十位 d1=(c%10)/1。 //取個位 po4=(point%10000)/1000。 //取1/10位 po3=(point%1000)/100。 //取1/100位 po2=(point%100)/10。 //取1/1000位 po1=(point%10)/1。 //取1/10000位}void display()//LCD顯示函數(shù){ //顯示溫度 wr_byte_ram(1,0x42,lcdtable[d3])。 //顯示百位 wr_byte_ram(1,0x43,lcdtable[d2])。 //顯示十位 wr_byte_ram(1,0x44,lcdtable[d1])。 //顯示個位 wr_byte_ram(1,0x45,lcdtable[10])。 //顯示小數(shù)點(diǎn) wr_byte_ram(1,0x46,lcdtable[po4])。 //顯示1/10位 wr_byte_ram(1,0x47,lcdtable[po3])。 //顯示1/100位 wr_byte_ram(1,0x48,lcdtable[po2])。 //顯示1/1000位 wr_byte_ram(1,0x49,lcdtable[po1])。 //顯示1/10000位 wr_length_ram(1,0x4A,C,1)。//顯示溫度單位}void dispNegativeTemp(uchar l) //LCD顯示負(fù)溫度{ convert(l)。//轉(zhuǎn)換 wr_length_ram(1,0x40, ,16)。//擦除字符 wr_length_ram(1,0x40, ,2)。//顯示負(fù)溫度 display()。 //LCD顯示函數(shù)}void dispPositiveTemp(uchar l) //LCD顯示正溫度{ convert(l)。 //轉(zhuǎn)換 wr_length_ram(1,0x40, ,16)。//擦除字符 wr_length_ram(1,0x40, +,2)。//顯示正溫度 display()。 //LCD顯示函數(shù) }main(){ ini_lcd1602()。 //初始化LCD。 Config905()。 //配置905 wr_length_ram(1,0x00, Temperature is:,16)。//顯示提示字符 while(1) { temp=0x0000。 temp=read_temp()。//讀取溫度 if(temp!=tempold) //數(shù)據(jù)有變化者,重新顯示 { tempnew=temp。 tdatalow=tempamp。0xff。 tdataheight=temp8。 point=tempamp。0x000F。//取小數(shù)位; point=point*625。//轉(zhuǎn)換為實(shí)際溫度 if(temp amp。 0x8000) //處理負(fù)溫度 { temp=tempamp。0x0FFF。//去除高4位的符號; temp=temp^0x0FFF。//取反; temp+=1。 temp=4。 //計(jì)算溫度,除以16; low=temp|0x00。 //取低字節(jié) dispNegativeTemp(low)。 //LCD顯示負(fù)溫度 low=low|0x80。 } else //處理正溫度 { temp=4。//計(jì)算溫度,除以16; low=temp|0x00。//取低字節(jié) dispPositiveTemp(low)。 //LCD顯示正溫度 } SetTxMode()。//設(shè)置為發(fā)送模式 TxPacket(tdataheight,tdatalow)。//發(fā)送函數(shù) tempold=tempnew。//存最新數(shù)據(jù) } }}檢測端(接收端)主程序:include include include include include //0 1 2 3 4 5 6 7 8 9 .unsigned code lcdtable[]={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x2e}。//lcd顯示代碼;uchar d1,d2,d3,po4,po3,po2,po1。 //個位,十位,百位,1/10位,1/100位,1/1000位,1/10000位;uchar low,tdatalow,tdataheight。 //溫度低字節(jié),未處理溫度的小數(shù)位uint temp,tempold,tempnew,point。//采集溫度,舊溫度,新溫度,實(shí)際溫度的小數(shù)位void convert(uchar c){ d1=0x00。 d2=0x00。 d3=0x00。 po1=0x00。 po2=0x00。 po3=0x00。 po4=0x00。 d3=(c%1000)/100。 //取百位 d2=(c%100)/10。 //取十位 d1=(c%10)/1。 //取個位 po4=(point%10000)/1000。 //取1/10位 po3=(point%1000)/100。 //取1/100位 po2=(point%100)/10。 //取1/1000位 po1=(point%10)/1。 //取1/10000位}void display()//LCD顯示函數(shù){ //顯示溫度 wr_byte_ram(1,0x42,lcdtable[d3])。 //顯示百位 wr_byte_ram(1,0x43,lcdtable[d2])。 //顯示十位 wr_byte_ram(1,0x44,lcdtable[d1])。 //顯示個位 wr_byte_ram(1,0x45,lcdtable[10])。 //顯示小數(shù)點(diǎn) wr_byte_ram(1,0x46,lcdtable[po4])。 //顯示1/10位 wr_byte_ram(1,0x47,lcdtable[po3])。 //顯示1/100位 wr_byte_ram(1,0x48,lcdtable[po2])。 //顯示1/1000位 wr_byte_ram(1,0x49,lcdtable[po1])。 //顯示1/10000位 wr_length_ram(1,0x4A,C,1)。//顯示溫度單位}void dispNegativeTemp(uchar l) //LCD顯示負(fù)溫度{ convert(l)。//轉(zhuǎn)換 wr_length_ram(1,0x40, ,16)。//擦除字符 wr_length_ram(1,0x40, ,2)。//顯示負(fù)溫度 display()。 //LCD顯示函數(shù)}void dispPositiveTemp(uchar l) //LCD顯示正溫度{ convert(l)。 //轉(zhuǎn)換 wr_length_ram(1,0x40, ,16)。//擦除字符 wr_length_ram(1,0x40, +,2)。//顯示正溫度 display()。 //LCD顯示函數(shù) }main(){ ini_lcd1602()。 //初始化LCD。 Config905()。 //配置905 init_serialm()。 //初始化串口 wr_length_ram(1,0x00, Temperature is:,16)。//顯示提示字符 while(1) { temp=0x0000。 SetRxMode()。//設(shè)置為接收模式 temp=RxPacket()。//接收溫度函數(shù) if(temp!=tempold) //數(shù)據(jù)有變化者,重新顯示 { tempnew=temp。 tdatalow=tempamp。0xff。 tdataheight=temp8。 point=tempamp。0x000F。//取小數(shù)位; point=point*625。//轉(zhuǎn)換為實(shí)際溫度 if(temp amp。 0x8000) //處理負(fù)溫度 { temp=tempamp。0x0FFF
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1