![]() |
![]() |
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 1970
Location: Sydney
Posts: 207
|
I am trying to read the date from the GPRMC sentence from an EM-406. Equipment is stationary. The problem is the location of the date field keeps changing because the two fields before it, Speed over ground and Course over ground keep changing at random (even though I am stationary) and they are variable length fields.
The speed over ground always seems to be 4 bytes (eg. 0.13 1.27 0.96 2.74...) but there are no guarantees that it will not be more. But the course over ground constantly changes length from 4 to 6 bytes since it does not pad with zeros on the left. eg. sample values: 327.78 24.35 7.62 242.45 15.37 Is there any way of stopping them from changing all the time so I know where the date is, or do I just have to read extra bytes and search for the commas to try to work out where the date field is? |
|
|
|
|
#2 |
|
Senior Member
Join Date: Jan 1970
Location: Portland OR
Posts: 266
|
The short answer is you'll have to count commas. Spiritplumber did a nice job with reading GPS in June. that will show you how it's done. He read most every part of the sentence--except time :-)
Just search all forums for GPRMC and his posts will come up. |
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 1970
Location: Christchurch, New Zealand
Posts: 748
|
Hi there,
Just a question, but does your GPS output ZDA? The reason for asking is that quite a few do, and date is very easy to extract. Mark
__________________
I thought I was wrong once ........ but I was mistaken! |
|
|
|
|
#4 |
|
Member
Join Date: Jan 1970
Posts: 55
|
Since the GPRMC number is going to be bigger than 32768, your best bet is to save each digit in its own variable, then manipulate them to only use what you need -- remember that subtracting 48 from the ascii value (30 in hex) will give you the real value -- you know the position of a digit, so past that it's just a matter of multiplying. The bad thing is that this method does use up a few variables, however, you can use peek/poke to preserve your vars.
|
|
|
|
|
#5 |
|
New Member
Join Date: Jan 1970
Posts: 2
|
Check this page http://www.softlab.ntua.gr/~sivann/gps2dtmf/ on how to read all NMEA information with a picaxe 18X.
Â* |
|
|
| Thread Tools | |
| Display Modes | |
|
|