A Simple GPS Problem
SteveWoodrough
Posts: 190
I'm trying to get usable data parsed out of my GPS module, and I'm attempting to use a program borrowed from The Official Guide, Chapter Nine. For the purpose of the example Im trying to display the GPS time value on the PST. I chose time since it changes and does not require me to move around to confirm an updated value.
My routine: GPS_String_to_PST works just fine, so I know the GPS works.
However, my routine: GPS_Time sends a bunch of repeated gibberish to the PST.
I'm sure this problem has been soleved a hundred times before, so if anybody has SIMPLE, one cog example where I can write Heading:=GPS.heading, I would apprciate it very much.
Thank You!
Steve
My routine: GPS_String_to_PST works just fine, so I know the GPS works.
However, my routine: GPS_Time sends a bunch of repeated gibberish to the PST.
I'm sure this problem has been soleved a hundred times before, so if anybody has SIMPLE, one cog example where I can write Heading:=GPS.heading, I would apprciate it very much.
Thank You!
Steve
Comments
Thank You!
Steve
You may want to protect yourself against returned NULL pointers which simply means this part isn't available (not necessarily the time entry).
Also, when you post code please wrap it in [noparse] [/noparse] tags.
I agree about code comments. As much as I appreciate the Chapter 9 code being posted to the FTP site the occasional lack of comments leaves guys like me in the dark.
I'll play with this tonight, but if I want the number values to the left of the decimal all I need to do is declare:
Time:= fds.str(time)
Likewise for the heading:
Heading:=fds.str(Heading)
Best Regards,
Steve
What is the best way to convert the string value to true number?
Thank You
Steve
The copy_buffer method looks slightly supicious as well as it scans 79 elements for arrays which are 68/80 and 40 in size.
Thank You for your prompt response. I think we can call this one solved, if I can just figure out how to re-label the post.
I will make the code changes you suggest to the Read_NEMA method.
Below is the code sample in the hopes that it helps the next person out.
Perry