Hardware Reference
In-Depth Information
Take a look at the $GPRMC
sentence as an example:
8
$GPRMC,155125.000,A,4043.8432,N,07359.7654,W,0.10,11.88,200407,,*20
RMC stands for Recommended
Minimum specifiC global navigation
system satellite data. It gives the basic
information almost any application
might need. This sentence contains the
information shown in the table.
Message identifier
$GPRMC
Time
155125.000 or 15:51:25 GMT
Status of the data (valid or not valid)
A = valid data ( V = not valid)
Latitude
4043.8432 or 40°43.8432'
North/South indicator
N = North ( S = South)
Using the NMEA protocol in a program
is just a matter of deciding which
sentence gives you the information you
need, reading the data in serially, and
converting the data into values you can
use. In most cases, the RMC sentence
gives you all the data you need about
position.
Longitude
07359.7654 or 73°59.7654'
East/West indicator
W = West ( E = East)
Speed over ground
0.10 knots
Course over ground
11.88 ° from north
Date
200407 or April 20, 2007
The Processing sketch shown next
reads NMEA serial data in and parses
out the time, date, latitude, longitude,
and heading. It uses the $GPRMC
sentence to get basic info, the $GPGSV
sentence to get the satellites in view,
and the $GPGGA sentence to get the
number of satellites used to obtain a
fix. It draws an arrow on the screen
to indicate heading. The output looks
like Figure 8-11. (Be sure to use the
Bluetooth serial port when opening the
serial port!)
none
Magnetic variation
Mode
none
Checksum (there is no comma before the
checksum; magnetic variation would appear to
the left of that final comma, and mode would
appear to the right)
*20
NOTE: Extra credit. Figure out where I was
when I wrote this chapter. Thanks to reader
Derrick O'Brien who figured out from the
first edition that there was an error in my
calculations, and introduced me to Glen
Murphy's excellent GPS processing example
at http://bodytag.org/p5gps/p5gps.pde . With
the changes in this edition, it will be easier
to find me.
Figure 8-11
The output of the Processing
GPS parser.
 
Search WWH ::




Custom Search