Skip to main content
added 219 characters in body
Source Link
Anum Sheraz
  • 191
  • 1
  • 5
  • 11

I want to get the GPS ordinates in degrees with 6 decimal accuracy. I can obtain this by creating a gps object with TinyGPS library. but In the TinyGPS example codes, its written

Serial.println(gps.location.lat(), 6);

But I actually want to store this latitude degrees in a variable of type string or float. Howwhen i write this;

double Tiny_latitude = (gps.location.lat());
Serial.print("Tiny lat:");
Serial.println(Tiny_latitude);      

it returns me Tiny lat:33.55 on serial monitor. But i want 33.546600. How do I do that ?

I want to get the GPS ordinates in degrees with 6 decimal accuracy. I can obtain this by creating a gps object with TinyGPS library. but In the TinyGPS example codes, its written

Serial.println(gps.location.lat(), 6);

But I actually want to store this latitude degrees in a variable of type string or float. How do I do that ?

I want to get the GPS ordinates in degrees with 6 decimal accuracy. I can obtain this by creating a gps object with TinyGPS library. but In the TinyGPS example codes, its written

Serial.println(gps.location.lat(), 6);

But I actually want to store this latitude degrees in a variable of type string or float. when i write this;

double Tiny_latitude = (gps.location.lat());
Serial.print("Tiny lat:");
Serial.println(Tiny_latitude);      

it returns me Tiny lat:33.55 on serial monitor. But i want 33.546600. How do I do that ?

Source Link
Anum Sheraz
  • 191
  • 1
  • 5
  • 11

Store TinyGPS++ latitude value into a variable of type string or float

I want to get the GPS ordinates in degrees with 6 decimal accuracy. I can obtain this by creating a gps object with TinyGPS library. but In the TinyGPS example codes, its written

Serial.println(gps.location.lat(), 6);

But I actually want to store this latitude degrees in a variable of type string or float. How do I do that ?