i am using GPS L80 to extract latitude and longitude.i used this program given below from allaboutee but its not working.can somebody help me with this. i am using uno board. here is the 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()
{
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
}
}
}
gps.ino (725 Bytes)