版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、%注:本程序可直接在 MAT L AB 2 0 17a中運(yùn)行%該腳本文件用于學(xué)習(xí) GPS數(shù)據(jù)得讀取,需要做其她用途請(qǐng)自行修改代碼本腳本文件得前面幾行代碼就是要設(shè)置得一些參數(shù)% 默認(rèn)使用 3( 需視情況修改) %波特率設(shè)為G PS模塊默認(rèn)得3 8400 % 下面為程序源碼clear num_ e xecu te = 100; % 執(zhí)行次數(shù)n umSin gle Re a d = 15 0;%單次從串口讀取得字節(jié)數(shù)(最好設(shè)置足夠大(最低大概設(shè)為8 0 ),保證單次讀取得數(shù)據(jù)包含一條完整得GPS數(shù)據(jù))Timede 1 ay =0、2;% 用于延時(shí)讀取串口數(shù)據(jù)Ba u dRate3840 0; % 讀
2、取數(shù)據(jù)得波特率Te rm inat or='C R'nu m_M axTry5;%打開串口得最多嘗試次數(shù)By te sAv ai lableFcnCo un t = 1 0 00;% % 設(shè)置參數(shù)% delet e (in s trf i nd a 1 l);%串口打開失敗時(shí)使用此句 % delete( s);c l ea r s %串口打開失敗時(shí)使用此句s eri a l3 = seria 1(3);% 串口設(shè)置 s eri a l3、B yte s Av a i 1 ab1 eFcnMode = b y t e'% seri a l3、Input Bu f f er
3、Si z e = 38 4 0 0 ; % 輸出波特率ser ial3、 Ba ud Ra te = BaudRate; % 讀入波特率% s eri a l3、Outpu tB uffe r Size =1024;ser i al 3、BytesA v a i l a bl e FcnCoun t = B yt esAvaila b1 eFc n Count;s e r i al 3、R ead A s yn c Mod e = 'cont i nuou sse rial 3、 Terminato r = Termi n ator ;% 打開串口co unt_o p e n tim
4、e s1;whi le c ontains(serial3、s tatus, l' ocse d') 0 & c ount_o p entimesnum_ MaxTryfopen (s er i a13 ); %打開串口en dc o u n t_op en tim es = count_ op en times+1;f contain s (ser ial3、 status,p'eno')< 1disp ('o pen failed!) ;ret u rne nd 讀取并處理數(shù)據(jù)% 初始化GP S Data = GPS Iit();whi
5、l e (num_e x ecutG PS DataS t r s =re a d(serial 3 ,n um _Sing leRead,'ch ar');% 一次讀出1 0個(gè)字符G P S Da taSt r s =r e shape(GP S _Dat a Str s,l 門);GPS_Dat a Strs =plit_str 2 s trs( G PS_Dat a Strs);GPS_D a t a_tmpget_GP S_sp eci ficData(GPS_Da t aStr s);GPS_Data = Upda t_GPU_D a t a (GP S_D ata,
6、GPS_D ata_tmp);s h ow_GP S _D a ta(GPS_Data);p au se(Timedelay ) ; 延時(shí)end給串口得發(fā)送數(shù)據(jù)% f p ri ntf (s ,'abc d ');% f s canf(s);% 從串口得接收緩存讀數(shù)據(jù) 關(guān)閉串口并刪除相關(guān)數(shù)據(jù)f c los e ( s e ria 13);關(guān)閉串口de 1 ete (seria 1 3);clear se r ia 1 3%將字符串根據(jù)n '劃分成多個(gè)子字符串,同時(shí)去掉首尾無用得殘余字符串u t strsspli t _str2 s tr s(StrData )if c
7、ontain s(c1 ass(S trData ) , ' char')u i n t 8( StrData );endre cord = g e t_po s_en terf 1 a g(S tr D at a );if StrD at a(1)= uint8('$') % 開頭為 $'得情況flag_s t art=1;e lseif si ze(reco rd ,2) > 0flag_start = reco r d (1)+ 2 ;e1 seo ut_st rs = cell(0,0);etu rne ndendif S trData(e
8、nd )= = 1 3flag_end =lengt h (Str D ata ) 1 ;elseif siz e(r e co rd ,2) > 0fla g _end = r ecord(e n d)-1 ;e ndendiff 1 a g _ s tart > = f la g_ e n do ut_s trs = c e ll (0,0);r etur nen dStr D a t a = St r Da t a(flag_s tart :flag_end ) ; 截取有效數(shù)據(jù) ,方便下面劃分子字符串record = ge t _pos_en t erflag(S trD
9、a ta) ;num_st r s = si ze (record ,2)+1 ;o u t strscell(num_strs,1);f n um_strs > 1out_strs1,1= char(StrData(1 : recor d (1) 1);i f nu m _strout _strsnurn _ s trs, 1= ch ar (S trData(reco r d(1)+ 2 :e n d);elseo r i = 2 :n u m_strs 1o ut_str s i, 1= char (S tr Da ta(record (i1)+2:r e cord (i)-1);
10、en dnd);ou t strs n u m _strs , 1 = cha r(St rD a t a (rec o rd(i) +2: eende 1 seou t _str s 1, 1= char(StrDa ta );%得到字符串中rn '在字符串中得位置(實(shí)際為、r得位置)funct i on rec o r d = get po s _enter f lag(d a ta)r e cord =;%記錄回車符號(hào)位置o r ii =1 :1 ength (d a ta) 1i f dat ad ata(i i + 1 )10re co rd = record ,ii;i =
11、 i i +1;en dendende nd en d%得到具體GPS結(jié)構(gòu)體數(shù)據(jù)f u n ctio n GP S _Data_t mp = get_G PS _spec ifi cDat a (StrsData)GP S _Dat a _t m p;num_s t r = size(St rsD a ta , 1);num strstr_tab = Str sD atai , 1;if con tai n s (str_ ta b,' GGA >)0G PS_Da t a_tm p = GNG GA (s tr_tab);els ei f c o ntains(str _tab
12、, ' GS') > 0GPS _D a t a tmp = G NG SA(s tr_tab);e ls e if cont ai ns (s t r_t a b,'GSV ' ) > 0GPS_Dat a_tmp = GNGSV(str_tab);elseif c o ntains( s tr_t ab,MC' >0G P S_Da ta_tmp = GNRM C(s t r _t a b);elseif c onta i n s (str_tab, ' VT >0GPS_Dat a _t m p = GN V TG(
13、 str _ t a b );else i f cont ain s( s tr t ab, 'EL/ ) > 0GPS_Data_t mp = G NGLL(s tr_tab);enden den d% GPS字符串解析f unc ti o n GPS_Da t a_ tm p = GN GGA (st r _tab)' ,');i nd e x = str f ind( s tr_tab, cou nt = 1 ;Timetr_ t a b (i nd ex(c ou n t)+1:i nde x (c ount+1 ) 1);c o un t =count+
14、1 ;Latit u detr_ta b (ind e x (count) + 1:in d ex (c ount+1) 1);count=c o un t+1;GP S _Dat a _t mp、La ti t ud eDistr_tab(i ndex(coun t)+ 1:index (count+ 1) 1);c ou n t =count +1 ;L ongitud est r_t a b( i n dex(co unt) +1 :ind ex(count+1 ) 1) ; c ou n t=count + 1;GPS_Data_tmp 、 Long itu deDir = str_t
15、ab(index (co unt)+1:index(cun t+1)-1);count= cou nt + 1 ;GPS _D ata _tmp 、 GPS St ate=st r _ tab( ind e xcount)+ 1:in dex(count+1)-1) ; co u nt = c o unt+1;G PS_D a ta_t m p、S atell i teNum =str_ t ab( i nd e x(c ont)+1:in dexcount +1 )1 );c oun t= c ount+1;GPS_D a ta_tm p、HD OP= str _ t a b (in d e
16、x( c o uindex( c oun t + 1 )1 );count=count+ 1;GPS_Data_ t mp 、 altitude= str_ t ab(in d ex(coun t )+1:dexcount+1 )-1) ; cou nt= c ou nt+1;% ot h er= st r _tab( index( coun t)+1end) ;% 進(jìn)一步處理GPS_Data_tmp 、 Time、 hour = Time(1 : 2);GPS_Dat a_t mp、 Time、 min = Time (3:4);GPS_Data_t m p、T ime、s e c = Ti
17、m e( 5:6 );G P S Data_tmp、Time、mil 1 isec = Ti m e (8 : 1 0 );G PS_D ata_t mp、Latitude、d eg ree = L a t i t ude(1:2);緯度GPS_Dat a_tm p、 Lati tude 、 min = L atitu de(3:4 ) ;tmp = s t r2doub 1 e(Lat i tude (6:9 );tmp =tmp61000; % t mptmp /1000 0 *60 ;GPS_Da ta_tmp、Latit ude、sec = num2 s tr( f1 oortmp )
18、 );G P S_ Data_tmp、L ati tude 、mi 1 lisec = n u m2 s t r ( t mp-flo o r(t mp )* 1 0000 );GPS_ D at a_tm p、Lon gitude 、 degr ee = Longitud e (1:3); % 經(jīng)度GPS Dat a _tm p、Lo n gi t ud e、min = L on g it ude (4:5);=tmp / 1 0 0 00*60;tmp = str2do u ble (Lon gitude(7:10) );tmp =tmp 6/1000 ; % tm pGP S_ Dat
19、a_tmp、Lon gitude、sec = n u m2 s tr( f lo o r( t mp);GPS_Data_tm p、L ongitude 、m or(tmp )100 00);i 1 lisec = nu m 2 s tr (tm% UT C時(shí)間轉(zhuǎn)換為北京時(shí)間ho ur = GPS_D a t a _ t mp、Ti me、 hou r;if str 2n um (hou r) +8 > =24GPS_D ata_ t mp、T ime、hou rnum2 st r(str2nu m(h o ur )+824);elseGPS_Dat a _tm p、 Time、 hou
20、r = num 2 str (st r 2numhour)+8 )e ndendfu nctio n GPS_D at a_tmp = GNGSA(st r_tab)index = st r find(st r_t ab,'/co unt =1;GPS_Data_ t mp、L ocati onMod e = s tr_tab(in d ex(count)+1:indexcoun t1 )1 ) ;co unt=cou n t+1 ;G PS_D at a _ t mp、Cu r S tate=s tr tab(index(co un t) +1:index( count1)1);co
21、unt=count+1;GP S _Dat a tmp、PRN ex(count+1 )-1); count=cou nt1;=str _t a b (in d e x (coun t )+ 1:indGPSData tm p、PD OPstrtab(i n de x (c ount) +1:i nd e x(co unt+ 1 )1); co unt=coun t +1 ;GPS_D a ta_tmp、HD OPst r _tab(ind e x( c oun t)+1:index(cou nt +1)-1) ; count=c ount+ 1 ;GPS_Da ta_ tm p、VD OPt
22、r _tab(in d ex( c ou n t) + 1 :i nde x( co unt+1)-1 );c ou nt= co unt+1; otherstr _tab (i n dex(co u nt) +1:end);endf unctio n GPS_Da t a_ t mp = GNGS V( str _t ab)% 此語句為與衛(wèi)星有關(guān)得信息 (包括衛(wèi)星方位 ,衛(wèi)星編號(hào))% 暫時(shí)用不著 , 不處理GPS_Data _t mp = ;endf un ct io n GPS_ D ata _ tmp = GNR M C (str_t a b)i nd ex = strfi nd(str
23、 _ tab ,',');c ount = 1 ;T i mest r_tab (ind ex(c ount) +:indeco unt+1) 1);co u nt= c ount +1;G P S_Datatm p、L oca t i o nSt a t e =str_ta b(inde x(cu nt)1:index (c oun t+1 )1); cou nt= c ount+1;Lat it ude= str_tab(inde x( c ou nt)+1:ndexexnt+1 ) -1);co un t=co u nt +1 ;G PS_Data_t mp、L a ti
24、t u de Di r = st r _ t ab (ind ex (cot)+1 :indco unt +1 ) -1);count=cou nt +1;o ngi tu d e= str_ t ab(i nde x(coun t)+:ind ex(count+ 1) -1 ); count = coun t +1;GPS_Data_t m p、Long itu d e D i r = str_t a b(ind e x(co u nt)+1 : inde x(cou n t+1) 1); count= c ou nt+1 ;GPS_Data_tmp、 speedstr_tab(i n de
25、 x (count) + 1:i ndex (c ount+ 1)1 );co un t=co un t+1;GPS_Data _tm p、True D ir=st r t a b(index(co unt )+ 1 : i nd ex(co unt + 1) -1) ; c ount= co un t+1 ;D ates tr_tab(index(count) +1:index (c o un t + 1) 1) ; count=co u nt+1;GPSDatatmp、Mag neticA n gle = st r _ta b ( in dex(c ou nt)+1 :ind eX(co
26、u nt + 1) 1)coun t =co u nt +1;G PS_D atat mp、 Ma gn eticDir = str_t ab( i ndex( co un t)+1 : inde X (co u nt+ 1 ) 1);c ount = c o u nt + 1;% o t he rstr_t ab(index (co unt)+1 : end); 進(jìn)一步處理GPS_Data _t mp、Time、ho ur =Ti me(1 : 2);GPS_Data_tmp 、 Time、m in = Tim e(3:4);GPS_ D atat m p、Tim e、sec = Tme(5
27、:6)GP S_Da ta_ t mp、Time、milise c = Ti m e( 8:1 0 );GPS_Data_tmp 、L atitude 、 degree = Latitud e(1:2 );% 緯度GPS_Data_t mp、 Latit ude、mi n =L ati t ude(3: 4 ););tmp = str2double(Lati t ude(6:9)t mp = tmp* 6 /1000 ;% t m p = tmp/10000*6 0;GP S _ D ata_ t mp、La ti tu de、sec=n um2 str (f l o o r (tm p );
28、GPS _Data_tm p、 *10000);Latitu d e、 millisec = num2 str( (tmp f l oor(t mp)GPS_D ata_tmp 、Longitude 、 degree = Longitude(1:3); % 經(jīng)度GPS _Data_ t mp 、Lo ngit ude、 min = Lon gitude(4: 5);tm p = s t r2double(L o ngitude(7: 1 0);tmp = tm p *6 /1 0 00;% tm p = t mp/100 0 0 * 60;G PS_D ata_tm p、Lon g i t u
29、de、sec = n um 2 s tr( f l oor(t mp );G PS_D a t a_tm p、Longitu d e、mil lis ec = num2s t r( (tm p fl oo r (tmp ) *100 0 0 );GPS_D ata_tmp、DATE、day = Date(1:2 );G PS_Data tmp、DATE、m o nth = D at e( 3:4 );GP S_D ata _tm p、D ATE、year = D ate (5: 6);% U TC時(shí)間轉(zhuǎn)換為北京時(shí)間h our = G P S_Dat a_tmp、 Time、hou r ;i f
30、 str2num(ho u r) + 8 > = 2 4GPS_ D ata_t824);m p、Ti m e、h o urn um2str(str 2 nu m ( hou r) +e lsee ndGPS_Data_tmp、 Time、 hou r =nu m2 st r (str2 num ( hou r )+ 8 );en dfunction GPS D ata tmp = G NVTG( str _ t ab)index = str find (str tab, ',/ );c ount = 1;G PS_D ata_tmp、Tr u eDir=str _tab(i n
31、 d e x(c o unt)+1:i n den t+1 ;x (co u nt+1 ) 1);count=couGPS_Dat a tmp、R efe r ence T rueD i r = str_tab(i nd ex(co unt ) +1 : ind ex (cou nt+1)-1 );c ount= c oun t+1;G P S_Data _t mp、Rel a t i veDirst rtab (i nde x (c o unt) +1:ind ex (count1)1); count= co un t1;st r _ t a b (ind e x(coun t)GP S D
32、atatm p、Ref er en ceRel a tiveDir =+1:i nd e x(co un t + 1) 1); co un t=cou n t+1;GPS_D a t a_tmp、s t epst r_ t ab(i ndex (count)+1 :i ndex(co unt 1 )1);cou nt =c ou n t +1;GP S Data_ t mp、ste pf 1 a gt r_ tab (i n d ex (co unt) + 1 :in dex(co un t + 1)-1);co un t=count + 1 ;GPS_D ata _t m p、v eloci
33、tys tr_tab(indexcount ) +1:index(count+1 ) -1) ; c o un t = c ount+1;% oth er= str_tab(inde x (count )+1:end );end functi o n GPS_Data_tmp = GN G LL (str_n dex = strfind(s tr _tab ,',' ;cou nt = 1;L atitud estr_ t ab(index(c ount ) 1 :index (cou n t+1) 1) ; cou nt = coun t+1;G P S_Data_tmp 、
34、 Latit udeDirs tr t ab( i ndex(count )+1:in d(count+ 1 )-1 );co un t=co u nt+1 ;L ongi t udes tr_tab (index(o unt)+1: index(unt+1) 1 ); c ou nt=count 1 ;G PS_Data_tmp 、 LongitudeD irs tr_ ta b( inex(count)1:indexc ou nt+1 )-1 );count=count 1;Date= str_tab ( index(cout) 1 :i ndex( count+1 )-1); co un
35、t = co u n t+1;GP SD at atmp、Loca tion Sta te = str_t a b(index (count)1:index(c ount+1)- 1);c ount=count+1; ot h e r=s t rtab(i n dex (c o un t )+ 1 :e n d);% 進(jìn)一步處理GPS_Dat a_tmp、 Lat itu de、 min = Latit ud e(3: 4);tm p = str2do u b 1 e( L atitude (6: 9);tm p = tmp*6/1000;% tmp = t m p/1000 0 * 60;G
36、PS _Dat a_tmp、Latitu de、s ec=n u m 2 str (f 1 o o r (tmp);GPS_Da ta_tm p、L a t it u de、 mil 1i sec = num2s t r( t mp flo o r(tmp) ) * 1 0 0 0 0 );GPS _D ata _ tmp、Lon g itude、degree = Lon git u de(1 : 3); % 經(jīng)度GPS_Da ta_tmp、 Longitude 、 min = Longitude(4: 5) ;tmpst r 2 d ou b le( L ongitude (7:1 0 );
37、tm p = t m p *6 / 10 0 0; % tmp = t mp /1 0 0 0 0*60 ;GP S_Data_tmp 、 Long it ude、 sec = n um2str(f 1o or(tmp);GPS_D a t a_tmp、Lo ngit u de、m illisec = num 2str( tm p f 1 o or( tmp) * 100 00);GP S _Data_tm p、D AT E、dayDa te(1:2);G PS_D ata _tmp 、D ATE、 monthDat e(3:4);GPS_D a ta_tmp、DAT E、year =Date
38、(5:6);% 更新獲取到得相關(guān)數(shù)據(jù)fun Ct ion G PS D ata =Updat a_G PU_Data(G PS_Data,GPS_Data _t mp )% 用不到得數(shù)據(jù)可以注釋掉i f is f ie 1 d( G PS_Da t at mp , Time') = 1GP S_Data、T ime、 hour = G P S_Data_tm p、T ime、hour ;GPS Dat a、Ti me、m in = GPS Dat a _tmp、Ti m e、m in;GPS_Dat a、 Time 、seeGPS_Data_tmp、Ti me、ec;G PS_ Dat
39、 a、Time、mi 11 isec = GPS_Data_t m p、T ime、mil 1 is e c;en d1 f isfie 1 d(GPS_ D at a_ t m p,DAT E ')GPS_Data、 DATE、 day = GPS_Dat a_tm p、D A TE、da y;GP S _D a t a、D ATE、m on th = GPS_ Data_tm p、DA TE、m o n t h;GPS _Dat a、 DATE、y ea r = G PS_Da ta_tmp 、D ATE、 year ;endif isfield(GPS_ Dat a_tmp,
40、39;La titu de') = 1GP S _Data、L a tit u de、d eg r ee = G PS_Data_ t mp、Lati t ud e、degree;GPS_Dat a、L atitude、mi n = GP SD ata_tm p、Latit u de、min;GPS_Da ta、L atitude 、 sec =GPS_Data_tmp 、 Latitu d e、se c;G PS_D ata、Lat itud e、m i l 1 isec = GPS_Data _t mp、Lat itude、mil 1 ise c ;ndisfield(GPS_Da
41、ta_tm p ,'L at itudeDir' )GPS_Data、 Lati tudeDir = GPS_Data _tmp、 LatitudeD ir;endif isf i eld( G PS_D a ta_ tm p,Longitude')G PS _Da t a、Lo ng i t u d e、deg r e e = G PS _Dat a _tmp、L on gitude、degr e e;GP S _Da t a、L ongi t ud e、min = GP S _D a t a _t mp、L ong i t ude、 mi n;GPS_Dat a、
42、Longit ude、 sec = GPS _Data_tmp 、 Longitu de、 sec ;GP S_D ata、L ong i t ude、mi llisec = GPS_D a t a_ t m p、L on gi tu de、mi 1 li s ec;endif isfield(G P S_ Data _t mp,L on gi t udeD)GPS_D a t a、Lo n g itude D ir = G P S_D at a _tmp、L ongitu d eDir;endif isfield(GPS Data_tmp, GP SStat e ')= = 1GPS
43、_Dat a、 GPSSt ate =GPS_D ata _tmp、GPSState;e ndif isf i eld(G PS _ D a ta _tmp , 'Sa t el l i t e Num')GPS D a ta、S a te l lit eN um = GPS Datatm p、S a t e lli t eNum ;endif isf ie ld(GP S_D ata_tmp, ' spe)ed '= 1if isfiGPS_Data、 speed = GPS _Data_tm p、 spee d;e ld(GP S D ata t mp, &
44、#39;velocity') = 1enG P S Data、ve l ocity = G P S_Datamp、veloci ty;i s f i eld (GPS _Data_t m p , Lo cati o nS t a t e)G P S Da t a、Lo cationStat e = GPS_Data_t mp、 Lo ca tionState;eni f isfield(GPS_Data _t mp,' altitude)'G PS D ata、a ltitude =G PS_Data _tmp、 altitude;en dif i sfi eld(GP
45、S_D ata _tmp ,'uCrS tate=)=1G P S Da ta、C urStateGPSD a ta_ t mp、Cur Stat e ;endif is fi eld(GPS_Data_ t mp , Loctio n M o de') = 1GPS_Data、 Locati onMode = GPS_Data _t mp、L oca ti onMo d e;if is f ield(GPS_ D ata_tm p,' HDO P' ) = 1G PS Data、H DO PGPS D a ta tmp、 HD OP ;en di s f i
46、el d (GPS_ Da ta_t mp,' VDOP')=GPS Da ta、VDO P = GPS Datatmp、VDOP ;endif isfield( GPS_Data_ t mp, ' POP') = = 1GPS_Da t a、PD OP = G P S_D ata_ t mp、PDOP;en dif is fi e ld(G PS _D a ta_tm p , T r ueD i r')GPS_Data、 TrueD irGPS_Data_tmp 、TrueDir;en difi s field(G P S_Data_tmp ,'
47、;Magn e ticAn g le')en dG PS_D ata 、 Magnet icAn gleGPSDat a t m p、MagneticAngle;i f isf i eld (GPS_Datatmp,M a gn et ic Di r ' ) = 1eneDir;GP S_D a t a、Mag n eticDir =is field ( GP S_Dat a_tm p, RefeGPS_D a ta_ t m p、Ma gn e t i cD ir en ce Tr u eDir') = = 1GPS_D a t a、R ef e renceTr u
48、eD i r = GPS_Dat a _tmp、Re f er e nceTr uendif i s f ie l d( GPS _ Da tatmp, R elativeDir='= 1GPS_D ata、R ela ti veDir = G PS_D a t a_t m p、R ela t iveDi f i s field (GPS_Da ta_t m p, Ref r enc e Rel ativeDi r ') = 1G P S_Data、Refere nee R e lativ e Dir = G P S_Da t a_tm p、Re f e r eceR e la
49、 t iveD i r ;if is field ( GP S_D atatm p ,' s tep )=GPS_D ata、step=G P S_D at a _ tmp、 st ep;endf isfield(GPS_Dat_tmp, 'tsep fl ag)= 1GPS_Data、stepflag = GPS _Da ta_t m p、 stepflag;endi f i s field ( GPS_Dat a_tmp ,'P RN')= 1GPS_Data、 PRN = GPS_Data _tm p、 PRN;enden d % 顯示相關(guān) GP S 數(shù)據(jù)
50、% 0 2 s:%02s:%f u ncti o n show_GPS_D a t a (GPS_Dat a )D ata AndTime = sprintf( 2 0'%0 2 s%02s-% 0 2s 2s: 03s ',、GPS _ D a ta、DA TE、y e ar, G PS_ Data、DA T E、mo n th,GP S _Data、DA TE、 day,、GPS _ Data、Time、ho ur, GP S_D ata、Time、mi n, GPS_Data、Time 、 sec,GPS_Data、 Tim e、 mil li see );Lo c at
51、 i on = sp r intf ( %s :%0 2 s°%02s %03s )4 s, s°%02s %03s ) 4 s',、%s:% 0 2eg ree,GPS_D ata 、La titude、m in ,GPS_Data、La ti tu de、sec,G PS _D a ta、Latitude、milli sG P S_ Da t a、L atitude D ir, GPS_Da t a、L atitude、dec,GPS_Dat a、Lon g itu de Dir ,GP S_Dat a、Long i tu d e、degree, GPSDat
52、a、 Lon gitude、 min,GPS_Da ta、Lo ngi tude、sec, GPS_Data、tu de、 millisec) ;Ot h e rs = s p r int f( ' GPSS tate:% s,Sate lliteNum:%02s, Speed :%03 s, V e lo c i t y:% s,Lo c ationS t ate:%'、,、Sa tell i te N um,GP SG PS _Dat a、 GPS Stat e,GPS_Dat a、_Data、sp eed , GPS_ Data、v e locity, GP S_D a
53、ta、Locati on S t at e);show_ M essag e _str (strca t( Dat a AndTi m e,Lo c at i o n ,Others);show_Message_st r (str c at ( Data A n dTim e , L o c at io n); en d%初始化G PS數(shù)據(jù)結(jié)構(gòu)體fu nctio n GPS_Da ta = GPS_I n it()GPS_D at a、Ti m e、h ou r'0;GPS _Data、 Time、 mi n ='0'GP S _Da t a、Timse c = '0'
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 茶園股份合作協(xié)議書
- 2025年安徽淮南壽縣蜀山現(xiàn)代產(chǎn)業(yè)園投資有限公司招聘筆試參考題庫附帶答案詳解
- 中考數(shù)學(xué)一輪復(fù)習(xí)考點(diǎn)練習(xí)考向23 多邊形及其內(nèi)角和(含答案詳解)
- 2025年度鋼管租賃與環(huán)保處理服務(wù)合同
- 2025年度個(gè)人環(huán)保產(chǎn)品銷售代理合同
- 2025版天然氣供應(yīng)合同技術(shù)服務(wù)范本模板3篇
- 2025-2030全球汽車NVH測(cè)試解決方案行業(yè)調(diào)研及趨勢(shì)分析報(bào)告
- 2025年全球及中國摻雜碘化銫閃爍晶體行業(yè)頭部企業(yè)市場(chǎng)占有率及排名調(diào)研報(bào)告
- 2025-2030全球工業(yè)數(shù)控木材激光切割機(jī)行業(yè)調(diào)研及趨勢(shì)分析報(bào)告
- 2025年度個(gè)人投資理財(cái)借款合同2篇
- 2025福建新華發(fā)行(集團(tuán))限責(zé)任公司校園招聘30人高頻重點(diǎn)提升(共500題)附帶答案詳解
- 山東鐵投集團(tuán)招聘筆試沖刺題2025
- 真需求-打開商業(yè)世界的萬能鑰匙
- 2025年天津市政集團(tuán)公司招聘筆試參考題庫含答案解析
- 搞笑朗誦我愛上班臺(tái)詞
- 汽輪機(jī)熱平衡圖功率的核算方法
- 賓館旅客財(cái)物保管制度
- 鉆孔樁水下混凝土灌注記錄(自動(dòng)生成)1
- nord stage 2用戶手冊(cè)簡(jiǎn)體中文版
- 5A+Chapter+2+Turning+over+a+new+leaf 英語精講課件
- 商業(yè)計(jì)劃書(BP)行業(yè)與市場(chǎng)的撰寫秘籍
評(píng)論
0/150
提交評(píng)論