Shop OBEX P1 Docs P2 Docs Learn Events
Storing GPS coordinates to memory — Parallax Forums

Storing GPS coordinates to memory

Carl LawhonCarl Lawhon Posts: 36
edited 2009-01-06 21:02 in Propeller 1
Ok guys, I have a question for you. My robot has a gps unit on it, and basically what I want it to do is to roam in a field collecting coordinates as it wanders. It then want to be able to pull those coordinates from it so that I can make a sort of map of its path. How can I get the bot to store the coordinates it reads to some sort of memory? More importantly how can I read back those coordinates from it on a computer? any help is greatly appreciated.

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-01-06 01:56
    Probably the easiest solution would be to use an SD card or USB stick. There are objects in the obex that you can use to interface with either one of these, and you can simply plug them into your computer to get the data.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-06 02:14
    Parallax sells a very nice USB Memory Stick Datalogger that would work well for this.· Hitt Consulting sells an SD card datalogger that works well, is small and uses little power.· It is limited in the size of the memory card that it can use and the kinds of file manipulation you can do.· It's really a datalogger.· The Parallax unit is more versatile, bigger and takes more power.
  • Carl LawhonCarl Lawhon Posts: 36
    edited 2009-01-06 02:21
    Thanks guys.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2009-01-06 03:08
    Carl, the protoboard has an extra 32k eeprom. If that is enough, it is already on you robot.

    John Abshier
  • SRLMSRLM Posts: 5,045
    edited 2009-01-06 03:11
    The onboard solution works, but you need some method of getting the data off the board and into your computer. You can have a special program for this, but it's more work. It's also a tradeoff between size ease of use.
  • Carl LawhonCarl Lawhon Posts: 36
    edited 2009-01-06 17:14
    Is there an object in the obex that would let me write/read the onboard eeprom? All the ones I have seen seem to interface with a peripheral memory.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-06 17:21
    The same objects work for the onboard EEPROM as well as EEPROM connected to other I/O pins. Basic_I2C_Driver will work with EEPROM on any pair of I/O pins including pins 28/29 which are used for the onboard EEPROM. The example in the comments at the beginning is for accessing the onboard EEPROM.
  • Carl LawhonCarl Lawhon Posts: 36
    edited 2009-01-06 17:23
    Thanks Mike. Didn't see that there.
  • Carl LawhonCarl Lawhon Posts: 36
    edited 2009-01-06 19:00
    Mike: Do I need a pull up resistor on either 28 or 29? I believe the program mentions that I do, but I'm not sure if that applies to onboard eeprom. Also, lets say I poll the gps once a second (its fastest update rate) and write the eeprom each time. Am I in any danger of wearing out the eeprom? Can the eeprom keep up?
  • RobofreakRobofreak Posts: 93
    edited 2009-01-06 19:33
    I have heard about EEPROM wearing out from too many repetitive writes, so what I do is just a simple IF statement comparison.
    Something along the lines of:

    IF (GPS_LAT <> EEPROM.READ(ADDR)) 'If the EEPROM addresses value is something other than GPS_LAT...
    EEPROM.WRITE(GPS_LAT, ADDR) 'Store GPS_LAT to the EEPROM address

    Of course I'm assuming much in this little example, like GPS_LAT is a variable holding the last latitude reading from the GPS, and EEPROM is an included object used for reading and writing to the external EEPROM. But this is pretty much what I do to avoid storing a value to the EEPROM that's already there.

    Hope this helps,
    Austin

    PS in the example, for some reason it won't show that the EEPROM.WRITE command is indented, but it of course should be to be used by IF

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Austin Bowen,

    Robo-freak.com
    www.livesoundforum.com

    "One must watch out for mechanics. They start out with a sewing machine, and end up with the atomic bomb" - A quote from someone that I saw on Addall.com

    "Not only do I see the glass as half empty, I wonder if anyone poisoned the glass with arsenic" - My dad, inside joke haha

    Post Edited (Robofreak) : 1/6/2009 7:42:49 PM GMT
  • John AbshierJohn Abshier Posts: 1,116
    edited 2009-01-06 20:19
    IO pins 28 & 29 are pulled up on the proboard.

    John Abshier
  • Carl LawhonCarl Lawhon Posts: 36
    edited 2009-01-06 20:29
    Thanks John. Also, what address should I use to access the onboard memory?
  • Carl LawhonCarl Lawhon Posts: 36
    edited 2009-01-06 21:02
    Here's the program I currently am attempting to run. For some reason it is having issues. Anybody see any problems?

    EDIT: I have figured everything out.

    Post Edited (Carl Lawhon) : 1/6/2009 9:39:05 PM GMT
Sign In or Register to comment.