Arduino GPS Shield by iteadstudio.com

Greetings, troyka 4484 and Paul'S. My name is Nataly from Venezuela.

I have the same gps shield by ITEAD STUDIO ver 1.1.

my question is:

in this image, where i have to put the correct jumper tx & rx ?

thanks for any help...

The RX and TX jumpers define which Arduino pins are used to receive from (RX) or transmit to (TX) the GPS, from the Arduino.

If you don't need to talk to the GPS, put the TX jumper in a drawer. If you want the GPS connected to the hardware serial port, put the RX jumper in column 0. If you want to use SoftwareSerial to listen to the GPS, put the RX jumper in column 2,, 3, 4, 5, 6, or 7, and tell SoftwareSerial which pin you selected. Obviously, the RX jumper bridges the RX row and the unlabeled row.

Pauls, I am using this code…

#include <TinyGPS.h>

TinyGPS gps;

static void gpsdump(TinyGPS &gps);
static bool feedgps();
static void print_float(float val, float invalid, int len, int prec);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_date(TinyGPS &gps);
static void print_str(const char *str, int len);

void setup()
{
  Serial.begin(9600);
  
  Serial.print("Testing TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
  Serial.print("Sizeof(gpsobject) = "); Serial.println(sizeof(TinyGPS));
  Serial.println();
  Serial.println("Sats HDOP Latitude Longitude Fix  Date       Time       Date Alt     Course Speed Card  Distance Course Card  Chars Sentences Checksum");
  Serial.println("          (deg)    (deg)     Age                        Age  (m)     --- from GPS ----  ---- to London  ----  RX    RX        Fail");
  Serial.println("--------------------------------------------------------------------------------------------------------------------------------------");
}

void loop()
{
  bool newdata = false;
  unsigned long start = millis();
  
  // Every second we print an update
  while (millis() - start < 1000)
  {
    if (feedgps())
      newdata = true;
  }
  
  gpsdump(gps);
}

static void gpsdump(TinyGPS &gps)
{
  float flat, flon;
  unsigned long age, date, time, chars = 0;
  unsigned short sentences = 0, failed = 0;
  static const float LONDON_LAT = 51.508131, LONDON_LON = -0.128002;
  
  print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
  print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
  gps.f_get_position(&flat, &flon, &age);
  print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 9, 5);
  print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 10, 5);
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);

  print_date(gps);

  print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 8, 2);
  print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2);
  print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
  print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0UL : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
  print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : TinyGPS::course_to(flat, flon, 51.508131, -0.128002), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);

  gps.stats(&chars, &sentences, &failed);
  print_int(chars, 0xFFFFFFFF, 6);
  print_int(sentences, 0xFFFFFFFF, 10);
  print_int(failed, 0xFFFFFFFF, 9);
  Serial.println();
}

static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, "*******");
  else
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len > 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  feedgps();
}

static void print_float(float val, float invalid, int len, int prec)
{
  char sz[32];
  if (val == invalid)
  {
    strcpy(sz, "*******");
    sz[len] = 0;
        if (len > 0) 
          sz[len-1] = ' ';
    for (int i=7; i<len; ++i)
        sz[i] = ' ';
    Serial.print(sz);
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1);
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(" ");
  }
  feedgps();
}

static void print_date(TinyGPS &gps)
{
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned long age;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
  if (age == TinyGPS::GPS_INVALID_AGE)
    Serial.print("*******    *******    ");
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d   ",
        month, day, year, hour, minute, second);
    Serial.print(sz);
  }
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  feedgps();
}

static void print_str(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i<len; ++i)
    Serial.print(i<slen ? str[i] : ' ');
  feedgps();
}

static bool feedgps()
{
  while (Serial.available())
  {
    if (gps.encode(Serial.read()))
      return true;
  }
  return false;
}

and this jumper setting…

however, I only get this result…

Sats HDOP Latitude Longitude Fix Date Time Date Alt Course Speed Card Distance Course Card Chars Sentences Checksum
(deg) (deg) Age Age (m) — from GPS ---- ---- to London ---- RX RX Fail

**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 167 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 334 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 501 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 668 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 1023 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 1255 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 1487 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 1689 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 1958 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 2209 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 2376 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 2543 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 2710 0 0

can you tell me in graphic, where put the correct jumpers?

:frowning:

and what code i have to add too.

Do you want to use the hardware serial port (pins 0 and 1) to talk to the GPS OR to the PC? You can't use it for both.

Move the jumpers over two columns to the left, and use SoftwareSerial (on pins 2 and 3) to talk to the GPS.

The TinyGPS library includes, I believe, and example that uses NewSoftSerial. Just change that to SoftwareSerial.

I want to try just the shield. using the arduino serial monitor, get latitude and longitude.

emmm, using the example> simple_test

i only see in the monitor serial… strange characters :S

#include <SoftwareSerial.h>

#include <TinyGPS.h>

/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 3(rx) and 4(tx).
*/

TinyGPS gps;
SoftwareSerial ss(3, 4);

void setup()
{
  Serial.begin(115200);
  ss.begin(4800);
  
  Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
}

void loop()
{
  bool newData = false;
  unsigned long chars;
  unsigned short sentences, failed;

  // For one second we parse GPS data and report some key values
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (ss.available())
    {
      char c = ss.read();
      // Serial.write(c); // uncomment this line if you want to see the GPS data flowing
      if (gps.encode(c)) // Did a new valid sentence come in?
        newData = true;
    }
  }

  if (newData)
  {
    float flat, flon;
    unsigned long age;
    gps.f_get_position(&flat, &flon, &age);
    Serial.print("LAT=");
    Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
    Serial.print(" LON=");
    Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
    Serial.print(" SAT=");
    Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
    Serial.print(" PREC=");
    Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());
  }
  
  gps.stats(&chars, &sentences, &failed);
  Serial.print(" CHARS=");
  Serial.print(chars);
  Serial.print(" SENTENCES=");
  Serial.print(sentences);
  Serial.print(" CSUM ERR=");
  Serial.println(failed);
}

i am using now this jumper setting…

Your jumpers are connecting the GPS to Arduino pins 2 and 3, not 3 and 4.

thank you very much Paul´s, the gps already working perfectly !!!!

:))

Hello guys I have the same GPS Shield

I was hoping someone can help please,I want to Log the data to the on board SD slot on the GPS shield
But it doesn’t seem to log the data to my SD Card :drooling_face:
Here is my code it is composed between a tutorial from Jerermy Blum and the Sample GPS code,and PaulS’s advice :slight_smile:

#include <TinyGPS.h>
#include <SD.h>
#include <stdlib.h>
#include <SoftwareSerial.h>

TinyGPS gps;
static char dtostrfbuffer[20];
const int chipSelect = 10;
int LED = 13;

//Define String
String SD_date_time = “invalid”;
String SD_lat = “invalid”;
String SD_lon = “invalid”;
String dataString ="";

static void gpsdump(TinyGPS &gps);
static bool feedgps();
static void print_float(float val, float invalid, int len, int prec, int SD_val);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_date(TinyGPS &gps);
static void print_str(const char *str, int len);

void setup()
{
//Serial interfaces
Serial.begin(9600);

pinMode(10, OUTPUT); //Chip Select Pin for the SD Card
pinMode(LED, OUTPUT); //LED Indicator

//Connect to the SD Card
if (!SD.begin(chipSelect))
{
Serial.println(“Card Failure”);
return;
}

Serial.print(“Testing TinyGPS library v. “); Serial.println(TinyGPS::library_version());
Serial.println(“by Mikal Hart”);
Serial.println();
Serial.print(“Sizeof(gpsobject) = “); Serial.println(sizeof(TinyGPS));
Serial.println();
Serial.println(“Sats HDOP Latitude Longitude Fix Date Time Date Alt Course Speed Card Distance Course Card Chars Sentences Checksum”);
Serial.println(” (deg) (deg) Age Age (m) — from GPS ---- ---- to London ---- RX RX Fail”);
Serial.println(”--------------------------------------------------------------------------------------------------------------------------------------”);
}

void loop()
{
bool newdata = false;
unsigned long start = millis();

// Every second we print an update
while (millis() - start < 1000)
{
if (feedgps())
newdata = true;
}

gpsdump(gps);

//Write the newest information to the SD Card
dataString = SD_date_time + “,” + SD_lat + “,” + SD_lon;
if (SD_date_time != “invalid”)
digitalWrite(LED, HIGH);
else
digitalWrite(LED, LOW);

//Open the Data CSV File
File dataFile = SD.open(“LOG.csv”, FILE_WRITE);
if (dataFile)
{
dataFile.println(dataString);
Serial.println(dataString);
dataFile.close();
}
else
{
Serial.println("\nCouldn’t open the log file!");
}
}

static void gpsdump(TinyGPS &gps)
{
float flat, flon;
unsigned long age, date, time, chars = 0;
unsigned short sentences = 0, failed = 0;
static const float LONDON_LAT = 51.508131, LONDON_LON = -0.128002;

print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
gps.f_get_position(&flat, &flon, &age);
print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 9, 5, 1); //LATITUDE
print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 10, 5, 2); //LONGITUDE
print_int(age, TinyGPS::GPS_INVALID_AGE, 5);

print_date(gps); //DATE AND TIME

print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 8, 2, 0);
print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2, 0);
print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2, 0);
print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0UL : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : TinyGPS::course_to(flat, flon, 51.508131, -0.128002), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2, 0);
print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);

gps.stats(&chars, &sentences, &failed);
print_int(chars, 0xFFFFFFFF, 6);
print_int(sentences, 0xFFFFFFFF, 10);
print_int(failed, 0xFFFFFFFF, 9);
Serial.println();
}

static void print_int(unsigned long val, unsigned long invalid, int len)
{
char sz[32];
if (val == invalid)
strcpy(sz, “*******”);
else
sprintf(sz, “%ld”, val);
sz[len] = 0;
for (int i=strlen(sz); i<len; ++i)
sz = ’ ';

  • if (len > 0)*
  • sz[len-1] = ’ ';*
  • Serial.print(sz);*
  • feedgps();*
    }
    static void print_float(float val, float invalid, int len, int prec, int SD_val)
    {
  • char sz[32];*
  • if (val == invalid)*
  • {*
    _ strcpy(sz, “*******”);_
  • sz[len] = 0;*
  • if (len > 0)*
  • sz[len-1] = ’ ';*
  • for (int i=7; i<len; ++i)*
    _ sz = ’ ';_
    * Serial.print(sz);*
    * if(SD_val == 1) SD_lat = sz;
    else if(SD_val == 2) SD_lon = sz;
    _
    }_
    _
    else*_
    * {*
    * Serial.print(val, prec);*
    * if (SD_val == 1) SD_lat = dtostrf(val,10,5,dtostrfbuffer);
    else if (SD_val == 2) SD_lon = dtostrf(val,10,5,dtostrfbuffer);
    _
    int vi = abs((int)val);_
    _
    int flen = prec + (val < 0.0 ? 2 : 1);_
    _
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;_
    _
    for (int i=flen; i<len; ++i)_
    _
    Serial.print(" ");_
    _
    }_
    _
    feedgps();_
    _
    }_
    static void print_date(TinyGPS &gps)
    _
    {_
    _
    int year;_
    _
    byte month, day, hour, minute, second, hundredths;_
    _
    unsigned long age;_
    gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
    if (age == TinyGPS::GPS_INVALID_AGE)
    _
    {_
    _ Serial.print("****** ******* ");
    * SD_date_time = “invalid”;
    _
    }*

    * else*
    * {*
    * char sz[32];*
    * sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d ",*
    * month, day, year, hour, minute, second);*
    * Serial.print(sz);*
    * SD_date_time = sz;
    _
    }_
    print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
    _
    feedgps();_
    _
    }_
    static void print_str(const char str, int len)
    _
    {
    _
    * int slen = strlen(str);*
    * for (int i=0; i<len; ++i)*
    _ Serial.print(i<slen ? str : ’ ');
    * feedgps();
    }
    static bool feedgps()
    {
    while (Serial.available())
    {
    if (gps.encode(Serial.read()))
    return true;
    }
    return false;
    }*
    Thanks in Advance!_

Did your source have italics in it? Did you read the sticky thread at the top of this section?

troyka_4484:
yes the code i attached worked…
now i am trying this TingGPS example

i tried both baud rates 9600 (it was used in the demo) & 38400 the baud rate give in the data sheet…
but all i get is stars…
here’s my results :

Testing TinyGPS library v. 12
by Mikal Hart

Sizeof(gpsobject) = 115

Sats HDOP Latitude Longitude Fix Date Time Date Alt Course Speed Card Distance Course Card Chars Sentences Checksum
(deg) (deg) Age Age (m) — from GPS ---- ---- to London ---- RX RX Fail

**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 173 0 0
**** **** ******* ******* **** ******* ******* **** ******* ****** ***** *** 0 0.00 *** 310 0 0
etc…

once again, thank you for your help, Paul :slight_smile:

I don’t know if anyone pointed this out to you yet but the reason you are getting stars is because these functions print stars if the data that it gets is invalid:

static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, "*******");
  else
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len > 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  feedgps();
}

static void print_float(float val, float invalid, int len, int prec)
{
  char sz[32];
  if (val == invalid)
  {
    strcpy(sz, "*******");
    sz[len] = 0;
        if (len > 0) 
          sz[len-1] = ' ';
    for (int i=7; i<len; ++i)
        sz[i] = ' ';
    Serial.print(sz);
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1);
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(" ");
  }
  feedgps();
}

static void print_date(TinyGPS &gps)
{
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned long age;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
  if (age == TinyGPS::GPS_INVALID_AGE)
    Serial.print("*******    *******    ");
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d   ",
        month, day, year, hour, minute, second);
    Serial.print(sz);
  }
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  feedgps();
}

The reason the data is coming up as invalid is because all it is receiving from the GPS is 0xFFFFFFFF which means the GPS is putting out data but it doesn’t have enough satellite fixes to output valid data. You can see that the UART is receiving information from the GPS because in your data above you can see the number of characters received go from 173 to 310. Once the GPS gets I believe 4 satellite fixes it will start putting out valid data. Are you testing this inside? Check out this video tutorial…it will help a lot:

Hello again guys, Sorry I was away with family for a bit , Sorry about the format of my code I am still new to this forum
I read the rules and Apologize :slight_smile:

Here is a correct format of my code :slight_smile:

#include <TinyGPS.h>
#include <SD.h>
#include <stdlib.h>
#include <SoftwareSerial.h>


TinyGPS gps;
static char dtostrfbuffer[20];
const int chipSelect = 10;
int LED = 13;

//Define String
String SD_date_time = "invalid";
String SD_lat = "invalid";
String SD_lon = "invalid";
String dataString ="";

static void gpsdump(TinyGPS &gps);
static bool feedgps();
static void print_float(float val, float invalid, int len, int prec, int SD_val);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_date(TinyGPS &gps);
static void print_str(const char *str, int len);

void setup()
{
 //Serial interfaces
  Serial.begin(9600);
  
   pinMode(10, OUTPUT);  //Chip Select Pin for the SD Card
   pinMode(LED, OUTPUT);  //LED Indicator
  
  //Connect to the SD Card
  if (!SD.begin(chipSelect))
  {
    Serial.println("Card Failure");
    return;
  }
  
  
  Serial.print("Testing TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
  Serial.print("Sizeof(gpsobject) = "); Serial.println(sizeof(TinyGPS));
  Serial.println();
  Serial.println("Sats HDOP Latitude Longitude Fix  Date       Time       Date Alt     Course Speed Card  Distance Course Card  Chars Sentences Checksum");
  Serial.println("          (deg)    (deg)     Age                        Age  (m)     --- from GPS ----  ---- to London  ----  RX    RX        Fail");
  Serial.println("--------------------------------------------------------------------------------------------------------------------------------------");
}

void loop()
{
  bool newdata = false;
  unsigned long start = millis();
  
  // Every second we print an update
  while (millis() - start < 1000)
  {
    if (feedgps())
      newdata = true;
  }
  
  gpsdump(gps);
  
  //Write the newest information to the SD Card
  dataString = SD_date_time + "," + SD_lat + "," + SD_lon;
  if (SD_date_time != "invalid")
    digitalWrite(LED, HIGH);
  else
    digitalWrite(LED, LOW);
    
  //Open the Data CSV File
  File dataFile = SD.open("LOG.csv", FILE_WRITE);
  if (dataFile)
  {
    dataFile.println(dataString);
    Serial.println(dataString);
    dataFile.close();
  }
  else
  {
    Serial.println("\nCouldn't open the log file!");
  }
}

static void gpsdump(TinyGPS &gps)
{
  float flat, flon;
  unsigned long age, date, time, chars = 0;
  unsigned short sentences = 0, failed = 0;
  static const float LONDON_LAT = 51.508131, LONDON_LON = -0.128002;
  
  print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
  print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
  gps.f_get_position(&flat, &flon, &age); 
  print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 9, 5, 1); //LATITUDE
  print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 10, 5, 2); //LONGITUDE
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);

  print_date(gps); //DATE AND TIME

  print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 8, 2, 0);
  print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2, 0);
  print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2, 0);
  print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
  print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0UL : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
  print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : TinyGPS::course_to(flat, flon, 51.508131, -0.128002), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2, 0);
  print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);

  gps.stats(&chars, &sentences, &failed);
  print_int(chars, 0xFFFFFFFF, 6);
  print_int(sentences, 0xFFFFFFFF, 10);
  print_int(failed, 0xFFFFFFFF, 9);
  Serial.println();
}

static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, "*******");
  else
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len > 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  feedgps();
}

static void print_float(float val, float invalid, int len, int prec, int SD_val)
{
  char sz[32];
  if (val == invalid)
  {
    strcpy(sz, "*******");
    sz[len] = 0;
        if (len > 0) 
          sz[len-1] = ' ';
    for (int i=7; i<len; ++i)
        sz[i] = ' ';
    Serial.print(sz);
    if(SD_val == 1) SD_lat = sz;
    else if(SD_val == 2) SD_lon = sz;
  }
  else
  {
    Serial.print(val, prec);
    if (SD_val == 1) SD_lat = dtostrf(val,10,5,dtostrfbuffer);
    else if (SD_val == 2) SD_lon = dtostrf(val,10,5,dtostrfbuffer);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1);
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(" ");
  }
  feedgps();
}

static void print_date(TinyGPS &gps)
{
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned long age;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
  if (age == TinyGPS::GPS_INVALID_AGE)
  {
    Serial.print("*******    *******    ");
    SD_date_time = "invalid";
  }
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d   ",
        month, day, year, hour, minute, second);
    Serial.print(sz);
    SD_date_time = sz;
  }
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  feedgps();
}

static void print_str(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i<len; ++i)
    Serial.print(i<slen ? str[i] : ' ');
  feedgps();
}

static bool feedgps()
{
  while (Serial.available())
  {
    if (gps.encode(Serial.read()))
      return true;
  }
  return false;
}

I am also new to C++ , We only did Pascal in my High School.
Like a mentioned in my first post I can’t seem to log the data to the SD card, I can see Latitude and Longitude on the Serial Monitor at 9600Baud
But also with a twist,the Serial Monitor gives out one reading and then the whole header part.
I attached the Image with an screenshot of the Serial monitor.
I am also using an Arduino Uno R3 and I am also using the Itead-Studio GPS Shield

I am using an spare 2GB Flash drive in the onboard SD slot I did format the SD Card to FAT, and I did put the LOG.csv file on the drive
But everytime when I test to see if Data has been logged I see no data has been logged to the SD Card.
Please guys if someone can point me in the right direction, I am still VERY new to Arduino.

Thanks alot guys!

Between the TinyGPS library, the SD library, and the String library, I'm guess that you are out of memory. The fact that the Arduino keeps resetting is proof of that.

Laziness is the only reason that the String class is being used in that code. Buck up and get rid of it.

Thanks Paul! Going to try that. According to Arduino IDE I am using 28046 bytes of the maximum 32,256? Does that mean I have already reached an Threshold amount of bytes?

According to Arduino IDE I am using 28046 bytes of the maximum 32,256?

That is how much program memory you are using. That says nothing about how much SRAM you are using. A sketch that size, though, pretty much implies more than you have, though.

Getting rid of the String class will help. Keeping some of the literal strings out of SRAM will help, too.

Serial.print(F("Testing TinyGPS library v. "));

Greetings and Hello,

First, excuse me for my poor english.

Some days i get two Arduino GPS Shield by iteadstudio (equal from title topic), version 1.1 .

Problem number 1 - My two Shield was set to 9600, not 4800.
Solution 1 - Easy, simple put Softserial to 9600.

This code simple get a value of pins from gps shield, (3 and 4) and send to my pc via default serial.

GPS Shield TX/RX(pin 3 and in 4) → Arduino (SoftwareSerial [read pin 3]) | Arduino (Serial [default]/USB) → PC (Arduino Serial Monitor)

#include <SoftwareSerial.h>
SoftwareSerial ss(3,4);
char c;
void setup() {
  Serial.begin(115200);
  ss.begin(9600);
  Serial.println("Begin...");
  delay(1000);

}

void loop() {
  while (ss.available()) {
    c = ss.read();
    Serial.print(c);
  }
}

Using the program above i get dump from GPS, but not signal from sat’s

$GPGGA,004651.052,,,,,0,00,,,M,0.0,M,,0000*57
$GPGLL,,,,,004651.052,V*19
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,3,1,12,20,00,000,,10,00,000,,31,00,000,,27,00,000,*7C
$GPGSV,3,2,12,19,00,000,,07,00,000,,04,00,000,,24,00,000,*76
$GPGSV,3,3,12,16,00,000,,28,00,000,,26,00,000,,29,00,000,*78
$GPRMC,004651.052,V,,,,,,,291006,,*22
$GPVTG,,T,,M,,N,,K*4E

The dump show me that i dont have any sat (…,0,00,…). Double zero equal zero sat.

$GPGGA,004651.052,,,,,0,00,,,M,0.0,M,,0000*57

I use an Samsung GalaxyTAB and GPS Test+ (Android APP)
The android APP show me 08 (eight) sat at equal location from my GPS arduino shield + arduino UNO

The only point is a GPS antenna. I dont have a square gps antenna.

Questions:
Is REALLY need a GPS antenna to get signal from sat’s ? Only the shield dont get any sat ?

I need to set any parameter or extra configuration to “start” get signal from sat ?

Thanks for any help…

You are doing this testing outside, right?

PaulS,

Yes, about 40 minutes running. Clear Sky, no clouds.

I would certainly have expected you to need an antenna. Ask on the ITEAD forum, or email them directly.

Hello I'm using the Arduino UNO and Arduino Mega2560 with the GPS Shield 1.1 from Itead Studio. I'm also using the TinyGPS Library and the SerialMonitor from the Arduino Software but I can't get any GPS data. I#m using the "simple_test" from TinyGPS. The RX jumper is on 3 and the TX jumper on 2. The only data I get are stars. Do I have to type something in the SerielMonitor? Sorry for my bad english. BlackDice