Trying to import a NMEA string into memory on BS2?
Waruma
Posts: 21
Hello all,
I'm trying to import a raw GPS NMEA string into the BS2 so I can manipulate the raw data within my program.· But I can't seem to import and store more than about 10 to 15 characters of the GPS string?· Can the Basic Stamp not handle a string of 70+ characters?
Thanks,
Warren
I'm trying to import a raw GPS NMEA string into the BS2 so I can manipulate the raw data within my program.· But I can't seem to import and store more than about 10 to 15 characters of the GPS string?· Can the Basic Stamp not handle a string of 70+ characters?
Thanks,
Warren
Comments
However, you can use the WAIT and SKIP parameters of the SERIN command to grab a certain part of the GPS string, process it then skip over the first batch of characters and grab the next goup of 10, process it then skip over the first two groups and grab 10 more, etc.
This method works because the GPS resends every few seconds and usually isn't physically moving fast enough for the position data to change too much between the 2 or 3 readings you need to take.
An alternative is a BS2sx with 60+ bytes of scratchpad RAM or BS2px with 100+ bytes in scratchpad plus a couple extra commands for putting serially received data directly into the scatchpapd.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
So when I tried to import a GPS string of $GPGSA,A,3,19...· Is each of the characters considered 1 byte?· Or is it considered 1 word?· I'm having trouble visualizing how large my data actually is...
thanks,
Warren
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
··· As pointed out, each character will use a byte of the array.
··· Once in the array, you can process the data according to whether its a number or ASCII character.
·· I've attached a program I used several years ago with a gps controlled farm tractor. Note that it ran in one slot of a BS2sx, its not the whole program but it will show you how to read in the gps data.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com