Help with GPS code please

growe19

  • Newbie
  • *
    • Posts: 2
    • View Profile
I followed the tutorial at http://www.instructables.com/id/Tinyduino-LEGO-GPS-battery-powered-Logger-DIY/?ALLSTEPS for a GPS logger with LEDs.

Unfortunately I've not had any success with the GPS getting a signal and logging to the SD.

The code is attached. Please could someone take a look and see why it isn't working.

Many thanks.


bowden100

  • Newbie
  • *
    • Posts: 4
    • View Profile
I followed the tutorial at http://www.instructables.com/id/Tinyduino-LEGO-GPS-battery-powered-Logger-DIY/?ALLSTEPS for a GPS logger with LEDs.

Unfortunately I've not had any success with the GPS getting a signal and logging to the SD.

The code is attached. Please could someone take a look and see why it isn't working.

Many thanks.

I think the problem is with your smart delay you have this and it should be this:

static void smartDelay(unsigned long ms)
{
  unsigned long start = millis();
  do
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

try:

static void smartDelay(unsigned long ms)
{
  unsigned long start = millis();
  do
  { // read all the data from the GPS -- otherwise it breaks the TinyGPS
     // this occurs every second from the GPS chip
    while (ss.available()>0)
       gps.encode(ss.read());

  } while (millis() - start < ms);
}


The other thing is some of the GPS chips require that you are outside inorder to get any signal.
They just return 0's if you are inside.  It should sync up in a few minutes outside..if not then something
else is wrong..


 

SMF spam blocked by CleanTalk