Hi,
I am new to Arduino and i am using TinyGPS.h to retrieve GPS data in following format:
LAT,LON =19.103648,72.880005 SAT=8
i am using following code:
#include <SoftwareSerial.h>
#include <TinyGPS.h>
TinyGPS gps;
SoftwareSerial ss(2, 3);
void setup()
{
Serial.begin(9600);
ss.begin(9600);
}
void loop()
{
while (ss.available())
{
char c = ss.read();
if (gps.encode(c)) // Did a new valid sentence come in?
{
float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Serial.print("LAT,LON =");
Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
Serial.print(",");
Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
Serial.print(" SAT=");
Serial.println(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
delay(1000);
}
}
}
the above code is working fine.
but when valid sentence is not available the TinyGPS library is not giving any output data.
now the question is, if there is a way to retrieve Latitude and Longitude data in above format even if GPS fix is not available.