Hoping someone can help me.
I have built a unit using the Fona808 module which can respond to a text message by replying with the relevant GPS coordinates. At the moment evverything is great, but I am just receiving the coordinates themselves which I need to cut and paste into google maps in order to view the location.
I am wanting to add a web address so the SMS will link directly to the maps. I know that I can add " https://maps.google.com/maps?q=" before the coordinates but I am struggling with the code and where to add it. My section of code dealing with the SMS GPS coordinates is below:
Code: Select all
fona.enableGPS(true); //Enable the GPS location so that it refreshes the data before sending
delay(6000); //Delay in order to get an accurate fix
float latitude, longitude;
fona.getGPS(&latitude, &longitude);
Serial.print(latitude,5) ; Serial.print("\t") ;
Serial.print(longitude,5) ; Serial.print("\t") ;
char message[28];
char LAT[9], LONG[9];
dtostrf(latitude, 6, 5, LAT); //gathering GPS data in a format that can be sent
dtostrf(longitude, 6, 5, LONG);
sprintf(message, "%s, %s", LAT, LONG); //showing how the message is to be made up.
Serial.println(message) ; //prints the message in the serial monitor before sending
fona.sendSMS(callerIDbuffer, message) ; //sends the message via SMS to the number stored in the callerIDbuffer
delay(10000); //delay to ensure task is completed
Many Thanks
Kev