my aim is to get the latitude and longitude only.
after testing, the serial monitor display both for latitude and longitude 0.000000
Thus, can someone help what i need to do to get the correct value. Below are my code and output result attached.
Thank You..
- CODE: SELECT_ALL_CODE
#include <TinyGPS.h>
#include <SoftwareSerial.h>
SoftwareSerial ss(0,1); //software serial pin for skm53 shield
TinyGPS gps;
float flat,flon;
void setup()
{
Serial.begin(9600);
ss.begin(9600);
Serial.print("");
Serial.print("Acquiring gps");
Serial.print("");
}
void loop()
{
while(ss.available())
{
char c=ss.read();
if(gps.encode(c))
{
gps.f_get_position(&flat,&flon);
}
{
Serial.println("");
Serial.print("Latitude:");
Serial.println(flat, 6);
Serial.print("Longitude:");
Serial.println(flon, 6);
delay(10000);
}
}
}