Can someone help me with the GPS reciever module source code/ program interpred
Xander
Posts: 23
Hello,
I need to know how location information are obtained from GPS receiver module & process into output to 4x20 serial LCD ? Which books or document should I reference to understand them ?
For example :
Get_Lat:
SEROUT Sio, Baud, [noparse][[/noparse]"!GPS", GetLat]
SERIN Sio, Baud, 1000, No_Response, [noparse][[/noparse]degrees, minutes, minutesD.HIGHBYTE, minutesD.LOWBYTE, dir]
' convert decimal minutes to tenths of seconds
workVal = minutesD ** $0F5C ' minutesD * 0.06
DEBUG MoveTo, FieldLen, 12, DEC3 degrees, DegSym, " ", DEC2 minutes, MinSym, " "
DEBUG DEC2 (workVal / 10), ".", DEC1 (workVal // 10), SecSym, " "
DEBUG "N" + (dir * 5)
' convert to decimal format, too
workVal = (minutes * 1000 / 6) + (minutesD / 60)
DEBUG " (", " " + (dir * 13), DEC degrees, ".", DEC4 workVal, " ) "
Why it is work this way ? Thank you.
Warm regards.
I need to know how location information are obtained from GPS receiver module & process into output to 4x20 serial LCD ? Which books or document should I reference to understand them ?
For example :
Get_Lat:
SEROUT Sio, Baud, [noparse][[/noparse]"!GPS", GetLat]
SERIN Sio, Baud, 1000, No_Response, [noparse][[/noparse]degrees, minutes, minutesD.HIGHBYTE, minutesD.LOWBYTE, dir]
' convert decimal minutes to tenths of seconds
workVal = minutesD ** $0F5C ' minutesD * 0.06
DEBUG MoveTo, FieldLen, 12, DEC3 degrees, DegSym, " ", DEC2 minutes, MinSym, " "
DEBUG DEC2 (workVal / 10), ".", DEC1 (workVal // 10), SecSym, " "
DEBUG "N" + (dir * 5)
' convert to decimal format, too
workVal = (minutes * 1000 / 6) + (minutesD / 60)
DEBUG " (", " " + (dir * 13), DEC degrees, ".", DEC4 workVal, " ) "
Why it is work this way ? Thank you.
Warm regards.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
Yes I know something about NMEA sentences. For my project, I will follow the GPGGA of NMEA sentences.
However, I wanted to know what the meaning of the code in the GOSUB section of the GPS module. Which document should I read to understand them better so I would write a report. Thank you.
Thanks Rick.
Warm regards.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
The code that you're talking about is for converting decimal minutes and seconds to degrees/minutes/seconds, I believe. For example, if you had 43.5000 degrees north, that is the same as 43 degrees, 30 minutes, 00 seconds north (since exactly 30 minutes is .5 degrees).
Now, what you get from the GPS module is the actual number of degrees, and the actual number of whole minutes, but then a number (actually, two bytes that you read into the HIGH and LOW bytes of a Word variable so they can be used together) representing the decimal fractions of minutes, and that needs to be converted to DDMMSS format (well, you could use it as is, but that's not the normal format that we use).
Notice the first piece of conversion code, reading
workVal = minutesD ** $0F5C ' minutesD * 0.06
As the comment indicates, it multiplies the number of fractional minutes by .06. If you look in the Stamp manual or the Stamp help file for information on operators, you'll see an explanation of how the ** operator can be used to do this kind of multiplication by a fraction. As I'm sure you're aware, you can't simply have
workVal = minutesD * .06
since .06 does not exist in the Stamp's integer mathematics.
Post Edited (sylvie369) : 2/8/2009 7:15:03 PM GMT
My program is about the same as the GPS module sample code. However, I did not include the altitude because there is a problem. I display the GPS information on my Parallax 4x20 serial LCD by using Serout command.
Thank you·sylvie369 and Franklin. I understand the code better now.
Warm regards.