c8051f單片機(jī)ad采樣程序 作者: 時(shí)間:2016-12-01 來源:網(wǎng)絡(luò) 加入技術(shù)交流群 掃碼加入和技術(shù)大咖面對面交流海量資料庫查詢 收藏 //***********************************************//修改時(shí)間//***********************************************if(Page ==7) //修改時(shí)間界面{ if(!(Mkey&0x02)) //SET按下嗎?設(shè)定SET只在7畫面設(shè)置時(shí)間{delayms(200);if(!(Mkey&0x02)){BGset =2;set = 2; //如果按下SET鍵表示開始設(shè)置時(shí)間,置設(shè)置標(biāo)志位;} }if(set == 2){if(!(Mkey&0x20)) //<- 按下嗎?左移<- 只在7畫面修改時(shí)間{delayms(200);if(!(Mkey&0x20)){BGset =2;direction--;if(direction < 1){direction = 6;}}}if(!(Mkey&0x80)) //->按下嗎?右移->只在7畫面修改時(shí)間{delayms(200);if(!(Mkey&0x80)){BGset =2;direction++;if(direction > 6){ direction = 1;} } }switch(direction){case 1:{if(!(Mkey&0x01)) //+按下嗎?{delayms(200);if(!(Mkey&0x01)){BGset =2;keybuffer[0]++;if(keybuffer[0]>99) //年設(shè)置,不超過100年{keybuffer[0] = 13;}} }if(!(Mkey&0x40)) //-按下嗎?{delayms(200);if(!(Mkey&0x40)){BGset =2;keybuffer[0]--;if(keybuffer[0]<13) //小于1畫面后不顯示0畫面,顯示6畫面{keybuffer[0] = 13;}} }if(Tset < 2){TH = keybuffer[0]/10;TL = keybuffer[0]%10;number_disp (0x8a,1,TAB[TH],TAB[TL]);}if(Tset>2){number_disp (0x8a,1,0x20,0x20); //定時(shí)送滅狀態(tài),實(shí)現(xiàn)閃爍}}break;case 2:{TH = keybuffer[0]/10;TL = keybuffer[0]%10;number_disp (0x8a,1,TAB[TH],TAB[TL]);if(!(Mkey&0x01)) //+按下嗎?{delayms(200);if(!(Mkey&0x01)){BGset =2;keybuffer[1]++;if(keybuffer[1]>12) //月設(shè)置,不超過12月{keybuffer[1] = 1;}} }if(!(Mkey&0x40)) //-按下嗎?{delayms(200);if(!(Mkey&0x40)){BGset =2;keybuffer[1]--;if(keybuffer[1]<1) //小于1 顯示12月{keybuffer[1] = 12;}} }if(Tset < 2){TH = keybuffer[1]/10;TL = keybuffer[1]%10;number_disp (0x8c,1,TAB[TH],TAB[TL]);}if(Tset>2){number_disp (0x8c,1,0x20,0x20); //定時(shí)送滅狀態(tài),實(shí)現(xiàn)閃爍}}break;case 3:{TH = keybuffer[1]/10;TL = keybuffer[1]%10;number_disp (0x8c,1,TAB[TH],TAB[TL]);if(!(Mkey&0x01)) //+按下嗎?{delayms(200);if(!(Mkey&0x01)){BGset =2;keybuffer[2]++;if(keybuffer[2]>31) //日設(shè)置,不超過31日{(diào)keybuffer[2] = 1;}} }if(!(Mkey&0x40)) //-按下嗎?{delayms(200);if(!(Mkey&0x40)){BGset =2;keybuffer[2]--;if(keybuffer[2]<1) //小于1,顯示31日{(diào)keybuffer[2] = 31;}} }if(Tset<2){TH = keybuffer[2]/10;TL = keybuffer[2]%10;number_disp (0x8e,1,TAB[TH],TAB[TL]);}if(Tset>2){number_disp (0x8e,1,0x20,0x20); //定時(shí)送滅狀態(tài),實(shí)現(xiàn)閃爍}}break;case 4:{TH = keybuffer[2]/10;TL = keybuffer[2]%10;number_disp (0x8e,1,TAB[TH],TAB[TL]);if(!(Mkey&0x01)) //+按下嗎?{delayms(200);if(!(Mkey&0x01)){BGset =2;keybuffer[3]++;if(keybuffer[3]>23) //時(shí)設(shè)置,不超過24{keybuffer[3] = 0;}} }if(!(Mkey&0x40)) //-按下嗎?{delayms(200);if(!(Mkey&0x40)){BGset =2;keybuffer[3]--;if(keybuffer[3]<=0) //小于1,顯示23{keybuffer[3] = 23;}} }if(Tset < 2){TH = keybuffer[3]/10;TL = keybuffer[3]%10;number_disp (0x9A,1,TAB[TH],TAB[TL]);}if(Tset>2){number_disp (0x9A,1,0x20,0x20);}}break;case 5:{TH = keybuffer[3]/10;TL = keybuffer[3]%10;number_disp (0x9A,1,TAB[TH],TAB[TL]);if(!(Mkey&0x01)) //+按下嗎?{delayms(200);if(!(Mkey&0x01)){BGset =2;keybuffer[4]++;if(keybuffer[4]>59) //分設(shè)置,不超過59{keybuffer[4] = 0;}} }if(!(Mkey&0x40)) //-按下嗎?{delayms(200);if(!(Mkey&0x40)){BGset =2;keybuffer[4]--;if(keybuffer[4]<=0) //小于1,顯示59{keybuffer[4] = 59;}} }if(Tset < 2){TH = keybuffer[4]/10;TL = keybuffer[4]%10;number_disp (0x9C,1,TAB[TH],TAB[TL]);}if(Tset>2){number_disp (0x9C,1,0x20,0x20);}}break;case 6:{TH = keybuffer[4]/10;TL = keybuffer[4]%10;number_disp (0x9C,1,TAB[TH],TAB[TL]);if(!(Mkey&0x01)) //+按下嗎?{delayms(200);if(!(Mkey&0x01)){BGset = 2;keybuffer[5]++;if(keybuffer[5]>59) //秒設(shè)置,不超過59{keybuffer[5] = 0;}} }if(!(Mkey&0x40)) //-按下嗎?{delayms(200);if(!(Mkey&0x40)){BGset = 2;keybuffer[5]--;if(keybuffer[5]<=0) //小于1,顯示59{keybuffer[5] = 59;}} }if(Tset < 2){TH = keybuffer[5]/10;TL = keybuffer[5]%10;number_disp (0x9E,1,TAB[TH],TAB[TL]);}if(Tset>2){number_disp (0x9E,1,0x20,0x20);}}break;default:break;}if(!(Mkey&0x04)) //ENT按下嗎?確認(rèn)ENT 只在6畫面設(shè)定時(shí)間{delayms(200);if(!(Mkey&0x04)){BGset =2; for(i=0;i<6;i++){time_buf1[i+1] = keybuffer[i]; }Ds1302_Write_Time(); //寫DS1302set = 0;Page = 1; //退出到1畫面} }} }}} //===================================//串口0 串口1發(fā)送函數(shù)//===================================void Uart0_SendData(uchar dat0){SBUF0=dat0; //寫SBUF0,開始發(fā)送while(!TI0); //等待發(fā)送TI0=0; //清發(fā)送標(biāo)志位}void Uart1_SendData(uchar dat1){SBUF1=dat1; //寫SBUF1,開始發(fā)送while(!(SCON1&0x02));SCON1 = (SCON1&0xfd); }void Timer2_Init(int ct2s){RCAP2H = -ct2s/0xff;RCAP2L = -ct2s;}//-----------------------------------------------------------------------------// Main 年:0xC4EA 月:0xD4C2 日:0xC8D5 時(shí):0xCAB1: 分0xB7D6: 秒:0xC3EB 的漢字內(nèi)碼//-----------------------------------------------------------------------------void main(void){//uint TEMP1,TEMP2,TEMP3,TEMP4,HT,HR,HP; //8路AD通道變量四路來料溫度 環(huán)境溫度濕度 橫坡度uchar i,j,Page1,BEW1,BEW2,BEW3,BEW4; //BEW1,BEW2,BEW3,BEW4; 拆分顯示的百,十,個(gè)位,小數(shù)點(diǎn)位中間變量Init_Device();P5 = 0xff;delayms(200);Ds1302_Init();init_lcd ();clrram (); ADC0CF = ((SYSCLK/SAR_CLK)-1)<<3; // set SAR clock to 3MHzADC1CF = ((SYSCLK/SAR_CLK)-1)<<3; // set SAR clock to 3MHzADC1CF |= 0x01; //ADC1增益設(shè)為1AD0EN = 1; //使能AC0啟動轉(zhuǎn)換ADC1CN &=~(0x80); //使能AC1啟動轉(zhuǎn)換TMR3CN = 0x04; //啟動TM3EA = 1;Timer2_Init(SYSCLK/12/100); //10ms//Ds1302_Write_Time() ;// Ds1302_Read_Time();for(j=0;j<7;j++){Between[j] = CSSZ_c[j]; //讀取FLASH }SZH0 = Between[0]/10;SZL0 = Between[0]%10;SZH1 = Between[1]/10;SZL1 = Between[1]%10;SZH2 = Between[2]/10;SZL2 = Between[2]%10;SZH3 = Between[3]/10;SZL3 = Between[3]%10;SZH4 = Between[4]/10;SZL4 = Between[4]%10;SZH5 = Between[5]/10;SZL5 = Between[5]%10;SZH6 = Between[6]/10;SZL6 = Between[6]%10;if(SZL0>9) SZL0 = 0;if(SZH0>9) SZH0 = 0;if(SZL1>9) SZL1 = 0;if(SZH1>9) SZH1 = 0;if(SZL2>9) SZL2 = 0;if(SZH2>9) SZH2 = 0;if(SZL3>9) SZL3 = 0;if(SZH3>9) SZH3 = 0;if(SZL4>9) SZL4 = 0;if(SZH4>9) SZH4 = 0;if(SZL5>9) SZL5 = 0;if(SZH5>9) SZH5 = 0;if(SZL6>9) SZL6 = 0;if(SZH6>9) SZH6 = 0;img_disp (tab32);delayms(5000);ET2 = 1;TR2 = 1;BLK = 0;//Ds1302_Write_Time() ;while(1){ key_scan();Ds1302_Read_Time();if(Page!=Page1){clrram (); //如果頁面變化,需要清屏;}switch(Page){case 1: //畫面1:顯示當(dāng)前{string_disp (0x80,16,page1);number_disp (0x89,1,0x32,0x30); //數(shù)字20number_disp (0x8b,1,0xc4,0xea); //年number_disp (0x8d,1,0xd4,0xc2); //月number_disp (0x8f,1,0xc8,0xd5); //日number_disp (0x9b,1,0xca,0xb1); //時(shí)number_disp (0x9d,1,0xb7,0xd6); //分number_disp (0x9f,1,0xc3,0xeb); //秒TH = time_buf1[1]/10; //年TL = time_buf1[1]%10;number_disp (0x8a,1,TAB[TH],TAB[TL]); TH = time_buf1[2]/10; //月TL = time_buf1[2]%10;number_disp (0x8C,1,TAB[TH],TAB[TL]);TH = time_buf1[3]/10; //日TL = time_buf1[3]%10;number_disp (0x8E,1,TAB[TH],TAB[TL]);TH = time_buf1[4]/10; //時(shí)TL = time_buf1[4]%10;number_disp (0x9A,1,TAB[TH],TAB[TL]);TH = time_buf1[5]/10; //分TL = time_buf1[5]%10;number_disp (0x9C,1,TAB[TH],TAB[TL]);TH = time_buf1[6]/10; //秒TL = time_buf1[6]%10;number_disp (0x9E,1,TAB[TH],TAB[TL]);Page1=Page; //保存當(dāng)前頁面值}break;case 2:{string_disp (0x82,8,page2); //顯示實(shí)時(shí)采集量string_disp (0x90,10,tab5);if(HTF){string_disp (0x97,2,tab8); //顯示℃BEW2 = HT/100; //環(huán)境溫度十位BEW3 = (HT%100)/10; //環(huán)境溫度個(gè)位BEW4 = (HT%100)%10; //環(huán)境溫度小數(shù)位if(!BEW2) //滅零處理{BEW2 = 10; }number_disp (0x95,1,TAB[BEW2],TAB[BEW3]);number_disp (0x96,1,0x2E,TAB[BEW4]);}else{string_disp (0x95,6,run2); }string_disp (0x88,10,tab6);if(HRF){string_disp (0x8f,2,run3); //顯示% //顯示%BEW2 = HR/100; //環(huán)境濕度十位BEW3 = (HR%100)/10; //環(huán)境濕度個(gè)位BEW4 = (HR%100)%10; //環(huán)境濕度小數(shù)位if(!BEW2) //滅零處理{BEW2 = 10; }number_disp (0x8D,1,TAB[BEW2],TAB[BEW3]);number_disp (0x8E,1,0x2E,TAB[BEW4]);}else{string_disp (0x8D,6,run2); }string_disp (0x98,8,tab7);BEW2 = HP/100; //橫坡度十位BEW3 = (HP%100)/10; //橫坡度個(gè)位BEW4 = (HP%100)%10; //橫坡度小數(shù)位if(HPF == 0) //負(fù)度數(shù)標(biāo)志位{number_disp (0x9C,1,0x2d,0x20);number_disp (0x9D,1,TAB[BEW2],0x2E);number_disp (0x9E,1,TAB[BEW3],TAB[BEW4]);number_disp (0x9f,1,0x20,0x20);}if(HPF == 1) //正度數(shù)標(biāo)志位 {number_disp (0x9C,1,0x2b,0x20);number_disp (0x9D,1,TAB[BEW2],0x2E);number_disp (0x9E,1,TAB[BEW3],TAB[BEW4]);number_disp (0x9f,1,0x20,0x20);}if(HPF == 2) //0度數(shù)標(biāo)志位 {number_disp (0x9C,1,0x20,0x20);number_disp (0x9D,1,TAB[BEW2],0x2E);number_disp (0x9E,1,TAB[BEW3],TAB[BEW4]);number_disp (0x9f,1,0x20,0x20);}if(HPF == 3) //未連接標(biāo)志位 {string_disp (0x9d,6,run2);number_disp (0x9C,1,0x20,0x20);}Page1=Page; }break;case 3: //顯示來料溫度 ADC04V 645 {string_disp (0x80,6,tab1);if(KT1F){string_disp (0x86,2,tab8); //顯示℃BEW1 = TEMP1/1000; //溫度百位BEW2 = (TEMP1%1000)/100; //溫度十位BEW3 = ((TEMP1%1000)%100)/10; //溫度個(gè)位BEW4 = ((TEMP1%1000)%100)%10; //溫度小數(shù)位if(!BEW1) //滅零處理{BEW1 = 10;if(!BEW2){BEW2 = 10; } }number_disp (0x85,1,0x2E,TAB[BEW4]);number_disp (0x84,1,TAB[BEW2],TAB[BEW3]);number_disp (0x83,1,0x20,TAB[BEW1]);}else{string_disp (0x84,6,run2); //顯示“未連接”number_disp (0x83,1,0x20,0x20); }string_disp (0x90,6,tab2);if(KT2F){string_disp (0x96,2,tab8); //顯示℃BEW1 = TEMP2/1000; //溫度百位BEW2 = (TEMP2%1000)/100; //溫度十位BEW3 = ((TEMP2%1000)%100)/10; //溫度個(gè)位BEW4 = ((TEMP2%1000)%100)%10; //溫度小數(shù)位if(!BEW1) //滅零處理{BEW1 = 10;if(!BEW2){BEW2 = 10; }} number_disp (0x95,1,0x2E,TAB[BEW4]);number_disp (0x94,1,TAB[BEW2],TAB[BEW3]);number_disp (0x93,1,0x20,TAB[BEW1]);}else{number_disp (0x93,1,0x20,0x20);string_disp (0x94,6,run2); } string_disp (0x88,6,tab3);if(KT3F){string_disp (0x8E,2,tab8); //顯示℃BEW1 = TEMP3/1000; //溫度百位BEW2 = (TEMP3%1000)/100; //溫度十位BEW3 = ((TEMP3%1000)%100)/10; //溫度個(gè)位BEW4 = ((TEMP3%1000)%100)%10; //溫度小數(shù)位if(!BEW1) //滅零處理{BEW1 = 10;if(!BEW2){BEW2 = 10; } }number_disp (0x8D,1,0x2E,TAB[BEW4]);number_disp (0x8C,1,TAB[BEW2],TAB[BEW3]);number_disp (0x8B,1,0x20,TAB[BEW1]);}else{number_disp (0x8B,1,0x20,0x20);string_disp (0x8C,6,run2);}string_disp (0x98,6,tab4);if(KT4F){string_disp (0x9E,2,tab8); //顯示℃BEW1 = TEMP4/1000; //溫度百位BEW2 = (TEMP4%1000)/100; //溫度十位BEW3 = ((TEMP4%1000)%100)/10; //溫度個(gè)位BEW4 = ((TEMP4%1000)%100)%10; //溫度小數(shù)位if(!BEW1) //滅零處理{BEW1 = 10;if(!BEW2){BEW2 = 10; } }number_disp (0x9D,1,0x2E,TAB[BEW4]);number_disp (0x9C,1,TAB[BEW2],TAB[BEW3]);number_disp (0x9B,1,0x20,TAB[BEW1]);}else{number_disp (0x9B,1,0x20,0x20);string_disp (0x9C,6,run2);}Page1=Page; }break;case 4: //{string_disp (0x80,10,page41);string_disp (0x88,10,page42); if(SPEEDTP<9999){BEW1 = SPEEDTP/1000;BEW2 = (SPEEDTP%1000)/100; //溫度十位BEW3 = ((SPEEDTP%1000)%100)/10; //溫度個(gè)位BEW4 = ((SPEEDTP%1000)%100)%10;if(!BEW1) //滅零處理{BEW1 = 10; }string_disp (0x95,6,run4);number_disp (0x94,1,TAB[BEW3],TAB[BEW4]);number_disp (0x93,1,TAB[BEW2],0x2E);number_disp (0x92,1,0x20,TAB[BEW1]);}else{string_disp (0x92,8,run6);}if(SPEEDNY<9999){BEW1 = SPEEDNY/1000;BEW2 = (SPEEDNY%1000)/100; //溫度十位BEW3 = ((SPEEDNY%1000)%100)/10; //溫度個(gè)位BEW4 = ((SPEEDNY%1000)%100)%10;if(!BEW1) //滅零處理{BEW1 = 10; }string_disp (0x9d,4,run5);number_disp (0x9C,1,TAB[BEW3],TAB[BEW4]);number_disp (0x9B,1,TAB[BEW2],0x2E);number_disp (0x9A,1,0x20,TAB[BEW1]);}else{string_disp (0x9a,8,run6);}Page1=Page; }break;case 5: //顯示定位信息{ string_disp (0x80,14,page6);string_disp (0x98,6,tab10);number_disp (0x9b,1,WD[0],WD[1]);number_disp (0x9c,1,WD[2],WD[3]);number_disp (0x9d,1,WD[4],WD[5]);number_disp (0x9e,1,WD[6],WD[7]);number_disp (0x9f,1,WD[8],WD[9]); string_disp (0x88,6,tab11);number_disp (0x8B,1,JD[0],JD[1]);number_disp (0x8C,1,JD[2],JD[3]);number_disp (0x8D,1,JD[4],JD[5]);number_disp (0x8E,1,JD[6],JD[7]);number_disp (0x8F,1,JD[8],JD[9]);//string_disp (0x98,6,tab12);//number_disp (0x9B,1,HIGH[0],HIGH[1]);//number_disp (0x9C,1,HIGH[2],HIGH[3]);//number_disp (0x9D,1,HIGH[4],HIGH[5]);Page1=Page; }break;case 6: //傳感器標(biāo)定 厚度顯示{ string_disp (0x80,8,page51);BEW1 = TPHD1/100;if(!BEW1) //滅零處理{BEW1 = 10; }BEW2 = (TPHD1%100)/10;BEW3 = (TPHD1%100)%10;number_disp (0x85,1,TAB[BEW1],TAB[BEW2]);number_disp (0x86,1,0x2E,TAB[BEW3]);number_disp (0x87,1,0x43,0x4d);string_disp (0x90,9,page52);BEW1 = TPHD2/100;if(!BEW1) //滅零處理{BEW1 = 10; }BEW2 = (TPHD2%100)/10;BEW3 = (TPHD2%100)%10;number_disp (0x95,1,TAB[BEW1],TAB[BEW2]);number_disp (0x96,1,0x2E,TAB[BEW3]);number_disp (0x97,1,0x43,0x4d);string_disp (0x88,13,page5);if (TPHD1>TPHD2){TPHD = TPHD1 - TPHD2; }else{TPHD = 0;}BEW1 = TPHD/100;if(!BEW1) //滅零處理{BEW1 = 10; }//if(BEW1>3) //超過3,異常數(shù),則清零//{// BEW1 = 10; // }BEW2 = (TPHD%100)/10;BEW3 = (TPHD%100)%10;number_disp (0x9d,1,TAB[BEW1],TAB[BEW2]);number_disp (0x9e,1,0x2E,TAB[BEW3]);number_disp (0x9f,1,0x43,0x4d);Page1=Page; }break;case 7: //修改時(shí)間{if(!(set==2)) //沒有按SET鍵{string_disp (0x80,10,page7); number_disp (0x89,1,0x32,0x30); //數(shù)字20number_disp (0x8b,1,0xc4,0xea); //年number_disp (0x8d,1,0xd4,0xc2); //月number_disp (0x8f,1,0xc8,0xd5); //日number_disp (0x9b,1,0xca,0xb1); //時(shí)number_disp (0x9d,1,0xb7,0xd6); //分number_disp (0x9f,1,0xc3,0xeb); //秒TH = time_buf1[1]/10; //年TL = time_buf1[1]%10;number_disp (0x8a,1,TAB[TH],TAB[TL]); TH = time_buf1[2]/10; //月TL = time_buf1[2]%10;number_disp (0x8C,1,TAB[TH],TAB[TL]);TH = time_buf1[3]/10; //日TL = time_buf1[3]%10;number_disp (0x8E,1,TAB[TH],TAB[TL]);TH = time_buf1[4]/10; //時(shí)TL = time_buf1[4]%10;number_disp (0x9A,1,TAB[TH],TAB[TL]);TH = time_buf1[5]/10; //分TL = time_buf1[5]%10;number_disp (0x9C,1,TAB[TH],TAB[TL]);TH = time_buf1[6]/10; //秒TL = time_buf1[6]%10;number_disp (0x9E,1,TAB[TH],TAB[TL]);for (j = 0;j<6;j++){keybuffer[j] = time_buf1[j+1];}}Page1=Page; //保存當(dāng)前頁面值 }break;case 0: //顯示故障狀態(tài){if(!(set==1)) //沒有按SET鍵{number_disp (0x82,1,0xb2,0xce); //參number_disp (0x83,1,0xca,0xfd); //數(shù)number_disp (0x84,1,0xc9,0xe8); //設(shè)number_disp (0x85,1,0xd6,0xc3); //置string_disp (0x90,8,tab13);string_disp (0x88,10,tab14); string_disp (0x98,10,tab15);number_disp (0x95,1,TAB[SZH2],TAB[SZL2]);number_disp (0x96,1,TAB[SZH1],TAB[SZL1]);number_disp (0x97,1,TAB[SZH0],TAB[SZL0]); //把前面的顯示了number_disp (0x8f,1,TAB[SZH3],TAB[SZL3]); number_disp (0x8e,1,TAB[SZH4],TAB[SZL4]);number_disp (0x9f,1,TAB[SZH5],TAB[SZL5]);number_disp (0x9e,1,TAB[SZH6],TAB[SZL6]); } Page1=Page; //保存當(dāng)前頁面值}break;default:break;} if(sendc){ sendc = 0;Uart0_SendData(0x7f); //首字符串Uart0_SendData(0x00); //數(shù)據(jù)包長度Uart0_SendData(0x38); //56個(gè)字節(jié) switch(Between[2]) //協(xié)議類型,0X0a攤鋪 0X14碾壓{case 0x0a:Uart0_SendData(0x0a); //攤鋪break;case 0x14:Uart0_SendData(0x14); //壓實(shí)break;default:Uart0_SendData(0x0a); //默認(rèn)0X0a break;} Uart0_SendData(0x00); //預(yù)留字節(jié) Uart0_SendData(0x00);Uart0_SendData(Between[2]); //IDUart0_SendData(Between[1]);Uart0_SendData(Between[0]);Uart0_SendData(0x14);Uart0_SendData(time_buf1[1]); //時(shí)間年月日時(shí)分秒U(xiǎn)art0_SendData(time_buf1[2]);Uart0_SendData(time_buf1[3]);Uart0_SendData(time_buf1[4]);Uart0_SendData(time_buf1[5]);Uart0_SendData(time_buf1[6]);for(i=0;i<12;i++) //經(jīng)度{Uart0_SendData(JD[i]);}for(i=0;i<11;i++) //緯度{Uart0_SendData(WD[i]);}Uart0_SendData(TPHD/100); //攤鋪厚度Uart0_SendData(TPHD%100);switch(Between[2]){case 0x10:Uart0_SendData(SPEEDTP/100); //攤鋪速度Uart0_SendData(SPEEDTP%100);break;case 0x20:Uart0_SendData(SPEEDNY/100); //壓實(shí)速度Uart0_SendData(SPEEDNY%100);break;default:Uart0_SendData(0x00); //壓實(shí)速度Uart0_SendData(0x00);break;}Uart0_SendData(TEMP1/100); //料溫Uart0_SendData(TEMP1%100);Uart0_SendData(TEMP2/100);Uart0_SendData(TEMP2%100);Uart0_SendData(TEMP3/100);Uart0_SendData(TEMP3%100);Uart0_SendData(TEMP4/100);Uart0_SendData(TEMP4%100);Uart0_SendData(HT/100); //環(huán)境溫度濕度橫坡度Uart0_SendData(HT%100);Uart0_SendData(HR/100);Uart0_SendData(HR%100);Uart0_SendData(HP/100);Uart0_SendData(HP%100);Uart0_SendData(TPrange/100);Uart0_SendData(TPrange%100);Uart0_SendData(0xa3); //結(jié)束符//Uart0_SendData(0xa5);//Uart0_SendData(0xa6);}}} 上一頁 1 2 3 下一頁
評論