The document describes GPS data variables and the logic used to parse GPS data received via interrupt, including latitude, longitude, time, speed and other variables, with the logic checking for start and separator characters to extract the values and store them in the appropriate variables. It also provides an example of the header format for a GPS data string with explanations of the fields.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
48 views2 pages
GPS: Data Variables
The document describes GPS data variables and the logic used to parse GPS data received via interrupt, including latitude, longitude, time, speed and other variables, with the logic checking for start and separator characters to extract the values and store them in the appropriate variables. It also provides an example of the header format for a GPS data string with explanations of the fields.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2
GPS:
Data Variables
Latitude gpsCurrentLatValue, tempGpsLatValue[7].
Latitude Direction gpsCurrentLatDirValue, tempGpsLatDirValue[1]. Longitude gpsCurrentLonValue, tempGpsLonValue[8]. Longitude Direction gpsCurrentLonDirValue, tempGpsLonDirValue[1]. UTC (time) gpsCurrentUtcValue, tempGpsUtcValue[6]. Speed gpsCurrentSpeed, tempGpsSpeedValue[5].
Position=latitude+longitude.
Function : gpsInit(); ---- Stores the values in all ‘Current’ variables .
A Navigation receiver warning A = OK, V = warning 4916.45,N Latitude 49 deg. 16.45 min North 12311.12,W Longitude 123 deg. 11.12 min West 000.5 Speed over ground, Knots 054.7 Course Made Good, True 191194 Date of fix 19 November 1994 020.3,E Magnetic variation 20.3 deg East *68 mandatory checksum Logic: getGpsData() { If(startGpsDataRx) { if gpsCurrentChar is ‘$’, then set gpsHeaderStart, Else if(gpsHeaderStart is set AND gpsCurrentChar is ‘,’) then gpsSeperator++; Else if(gpsHeaderStart is set AND gpsSeperator==3) { tempGpsLatVal[gpsTempVar]=gpsCurrentChar; if(gpsTempVar==7) { gpsCurrentLatVal=tempGpsLatVal; gpsTempVar=0; } gpsTempVar++; } Reset startGpsDataRx; Enable the interrupt; } } gpsDataRxIntr() { gpsCurrentChar=received char; set startGpsDataRx; Disable the intr; }