First of all Im sorry, im quit new to this.
*This code is a part of much larger code which tracks you via GPS and sends the coordinates via GSM
I cant tell what is wrong with this line of codes to clear the whole string and to enable clearer readings, In return data doesn't refresh and give the current location it just sends the initial coordinates when I turned it on.
String sendData (String command , const int timeout ,boolean debug)
{
String response = "";
sim808.println(command);
long int time = millis();
int i = 0;
while ( (time+timeout ) > millis())
{
while (sim808.available())
{
char c = sim808.read();
response +=c;
}
}
if (debug)
{
Serial.print(response);
}
return response;
}