1

The GPS SKM53 module is not returning any latitude and longitude data.

I use the following code:

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

long lat,lon; // create variable for latitude and longitude object

SoftwareSerial gpsSerial(2,3); // create gps sensor connection
TinyGPS gps; // create gps object

void setup(){
  Serial.begin(9600); // connect serial
  gpsSerial.begin(4800); // connect gps sensor
}

void loop(){
  if(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

   }
  }
}

Output in the serial monitor : http://postimg.org/image/w0kn433bf/

migrated from electronics.stackexchange.com Feb 24 '15 at 1:12

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

  • Which board are you using? I also faced the same problem with an uno board. – Osh Mansor Sep 23 '15 at 6:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.