GPS Tracker

Here is my code, the result is a .txt file on the sd that has no text or anything in it.

// Based off of Finding Your Way With GPS from the Make Magazine #35

//SD Tracker for Adafruit Ultimate GPS Breakout v3
//Using a SeeedStudio SD card sheild v3.1

//Breakout Pin------Arduino pin
//   TX       ------     D2
//   RX       ------     D3
//   VIN      ------     5V
//   GND      ------     GND

#include <SPI.h>  //include librarys
#include <SD.h>
#include <SoftwareSerial.h> 
#include <TinyGPS++.h>
#define RXPin 2   //define pins
#define TXPin 3 
#define GPSBaud 4800   //define baud rates
#define ConsoleBaud 115200

SoftwareSerial ss(RXPin, TXPin); // The serial connection to the GPS device
TinyGPSPlus gps; // The TinyGPS++ object

const int chipSelect = 10;  //Setup the SD card chip select
File myFile;  //Make a file on the SD card

void setup()
{
   /* make sure that the default chip select pin is set to
   output, even if you don't use it:*/
  pinMode(SS, OUTPUT);
  if (!SD.begin(chipSelect)) {   // see if the card is present and can be initialized:
    return;
  }

  myFile = SD.open("Trip1.txt", FILE_WRITE);
  //turn on next line for debuging
  //Serial.begin(ConsoleBaud); 
  ss.begin(GPSBaud);


  myFile.println("GPS Tracker");
  myFile.println("A simple tracker using TinyGPS++, SD, SPI, and Software Serial");
  myFile.println("by Alexander Pope");
  myFile.println();
}

void loop()
{
  // if the file opened okay, write to it:
  if (myFile) {
  // If any characters have arrived from the GPS,
  // send them to the TinyGPS++ object
  while (ss.available() > 0)
    gps.encode(ss.read());

  // Let's display the new location and altitude
  // whenever either of them have been updated.
  if (gps.location.isUpdated() || gps.altitude.isUpdated())
  {
    myFile.print("Location: "); 
    myFile.print(gps.location.lat(), 6);
    myFile.print(",");
    myFile.print(gps.location.lng(), 6);
    myFile.println("  Altitude: ");
    myFile.print(gps.altitude.meters());
    }
  }
  if (gps.time.isUpdated()) 
  {
    char buf[80];
    sprintf(buf, "The time is %02d:%02d:%02d", gps.time.hour(), gps.time.minute(), gps.time.second());
    myFile.println(buf);
  }
  }
  else{
  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile = SD.open("Trip1.txt", FILE_WRITE);
}
}

(deleted)

Post links to your hardware, gps, sd shield etc. There could be conflict of pins or simply wrong pin used like spycather2k said.

spycatcher2k:
Can you write to a file on the SD without the GPS Stuff? as I have had SD shields with other pins as the CS pin.

Thanks, that worked, I used the built in data logger. But when it comes out i have to convert it to another format.

what did you do to format it? all i can do is log data with 2 decimal places but I need at least 4

all i can do is log data with 2 decimal places but I need at least 4

You did 't post any code, but if you're using floats and the standard print methods, a quick read of the reference should put you straight.