PDA

View Full Version : Datalogging with GPS



Casey Gross
11-01-2009, 03:57 AM
I have made the GPS give me my position but so far i have not been able to write those coordinates to the bs2.
example of received coordinates\/ \/ \/ \/

3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W
3251.7702 N 9649.2256 W

I·need the stamp to save these coordinates for later use.
Any help is appreciated. (http://dictionary.reference.com/browse/appreciated)

SRLM
11-01-2009, 04:28 AM
Search the forums (using google). There are three projects out there that I can think of off hand that do what you need. I leave it as an exercise to you to find them.

Reminds me of a quote: "Fortune helps him who is willing to help himself."

Casey Gross
11-01-2009, 04:31 AM
ive been searching for awhile, before this post havent found anything...

Mike Green
11-01-2009, 04:44 AM
The BS2 has limited storage (2K bytes) that is shared with the compiled program. You store data in this EEPROM storage using the WRITE statement. There are examples of this statement and how to store data in the EEPROM using it in the Stamp Manual and in the help files of the Stamp Editor. You've got about 25 bytes per GPS reading. Assuming your program takes about 1/2 the memory, that leaves about 1K bytes which would hold 40 sets of coordinates.

25 bytes is about all the variable storage that a BS2 has. Where are you storing the data in the Stamp?

SRLM
11-01-2009, 06:34 AM
The best one is on the first page...

www.google.com/search?hl=en&rlz=1C1GGLS_enUS316US316&q=GPS+Basic+Stamp+site:forums.parallax.com&aq=f&oq=&aqi= (http://www.google.com/search?hl=en&rlz=1C1GGLS_enUS316US316&q=GPS+Basic+Stamp+site:forums.parallax.com&aq=f&oq=&aqi=)

Casey Gross
11-02-2009, 04:14 AM
This is the code I have, Im try to have it write just one coordinate and read it. I get these coordinates back: 1 79.0022 N.
but the coordinates the gps gives me are: 32 51.7702 N. Why is it storing the wrong coordinates?


' {$STAMP BS2}
' {$PBASIC 2.5}
gpstime VAR Word
N VAR Word
W VAR Word
NN VAR Word
WW VAR Word
speed1 VAR Word
speed2 VAR Nib
course1 VAR Word
course2 VAR Nib
address VAR Word
n4800 CON 16572

main:
SERIN 15,n4800,[WAIT("RMC,"),DEC gpstime, SKIP 3, DEC N, DEC NN, SKIP 3, DEC W, DEC WW, SKIP 3, DEC speed1, DEC speed2, DEC course1,DEC course2]
WRITE 0, N, NN
READ 0, N, NN
DEBUG DEC N/100," ",DEC N//100,".", DEC4 NN," N "

SRLM
11-02-2009, 05:24 AM
You aren't accounting for the 16 bit max variable size. The highest unsigned value that you can store is 65535. So for one it will overflow on GPS time, which may screw things up further down the chain. You have the potential to be doing something similar for DEC w. Finally, READ and WRITE are byte sized commands. If you want to use words with them then you have to specifically say so.

One last comment. Your code will be much easier to read if you choose meaningful variable names, instead of one or two letters.

Casey Gross
11-02-2009, 05:30 AM
Thanks SRLM, I know what to do now