Hi to all,
I have this:
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 6);
Serial.print(" Longitude= ");
Serial.println(gps.location.lng(), 6);
and I need to do this:
latlon = (gps.location.lat() + "," + gps.location.lng(), 2);
Serial.println(latlon);
How can I do that?
Thank you in advance.
Can you please explain more about what you are trying to do and why?
It looks like you are trying to change the 6 places after dp to 2 and add a comma between the values. What is reading the serial output?
Why not this. It would be unusual for the receiving side to require a concatenated statememnt.
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 2);
Serial.print(',');
Serial.print(" Longitude= ");
Serial.println(gps.location.lng(), 2);
if the line is giving you an error try casting?????
latlon = (String(gps.location.lat()) + "," + String(gps.location.lng()));
Thank you all for your help