Ultimate GPS Logger Shield

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
robothand
 
Posts: 38
Joined: Mon Oct 15, 2012 2:48 pm

Ultimate GPS Logger Shield

Post by robothand »

I am working with the ultimate GPS logger shield and I am trying to make a code that just gives me the latitude and longitude coordinates and nothing else. The code that I am using is

Code: Select all

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

long lat,lon; // create variable for latitude and longitude object
 
SoftwareSerial gpsSerial(8, 7); // create gps sensor connection
TinyGPS gps; // create gps object
 
void setup(){
Serial.begin(9600); // connect serial
gpsSerial.begin(4800); // connect gps sensor
}
 
void loop(){
while(gpsSerial.available()){ // check for gps data
if(gps.encode(gpsSerial.read())){ // encode gps data
gps.get_position(&lat,&lon); // get latitude and longitude
// display position
Serial.print("Position: ");
Serial.print("lat: ");Serial.print(lat);Serial.print(" ");// print latitude
Serial.print("lon: ");Serial.println(lon); // print longitude
}
}
}
When running this code I just get a blank page in the Serial Monitor. If you see the problem please help.
thanks

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Ultimate GPS Logger Shield

Post by Franklin97355 »

Which Arduino are you running this on?

User avatar
robothand
 
Posts: 38
Joined: Mon Oct 15, 2012 2:48 pm

Re: Ultimate GPS Logger Shield

Post by robothand »

The Arduino Uno

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Ultimate GPS Logger Shield

Post by Franklin97355 »

Does the GPS shield work with the example code?

User avatar
robothand
 
Posts: 38
Joined: Mon Oct 15, 2012 2:48 pm

Re: Ultimate GPS Logger Shield

Post by robothand »

It works with the blank code

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”