Re: How to take data from gps then send to my phone in arduino uno?

hi i have a problem with this project
my project is GPS tracking Sys and send lat&long sms to mobile
the problem in the code
and Should I use sheld or not؟
i use arduino uno + GSM 900 +lcd
and if any one have a correct code
Him very much

#include <TinyGPS.h>
#include <SoftwareSerial.h>
#include<LiquidCrystal.h>

LiquidCrystal lcd(12,11,10,9,8,7);
unsigned long fix_age;
SoftwareSerial GPS(4,5);
SoftwareSerial SIM900(2, 3);
TinyGPS gps;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
long lat, lon;
float LAT, LON;
void setup(){

lcd.begin(16,2);
GPS.begin(9600);
Serial.begin(9600);
SIM900.begin(19200);
SIM900power();
delay(20000); // give time to log on to network.
}
void loop(){
long lat, lon;
unsigned long fix_age, time, date, speed, course;
unsigned long chars;
unsigned short sentences, failed_checksum;
gps.get_position(&lat, &lon, &fix_age);
getGPS();
Serial.print("Lat : “);
Serial.print(LAT/100000,7);
Serial.print(” :: Long : ");
Serial.println(LON/100000,7);
lcd.setCursor(0,0);
lcd.print("lat : ");
lcd.setCursor(0,1);
lcd.print(LAT/100000,7);
lcd.setCursor(0,1);
lcd.print("long : ");
lcd.setCursor(0,3);
lcd.print(LON/100000,7);
sendSMS();
do {} while (1);
}
void getGPS(){
bool newdata = false;
unsigned long start = millis();
while (millis() - start < 1000)
{
if (feedgps ()){
newdata = true;
}
}
if (newdata)
{
gpsdump(gps);
}
}
bool feedgps(){
while (GPS.available())
{
if (gps.encode(GPS.read()))
return true;
}
return 0;
}
void gpsdump(TinyGPS &gps)
{
gps.get_position(&lat, &lon);
LAT = lat;
LON = lon;
{
feedgps();
}
}

void SIM900power()
// software equivalent of pressing the GSM shield “power” button
{
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(5000);
}

void sendSMS()
{
SIM900.print(“AT+CMGF=1\r”); // AT command to send SMS message
delay(100);
SIM900.println("AT + CMGS = “00000000000"”); // recipient’s mobile number, in international format
delay(100);
SIM900.println(“LAT/100000,7 LON/100000,7”); // message to send

delay(100);
SIM900.println((char)26); // End AT command with a ^Z, ASCII code 26
delay(100);
SIM900.println();
delay(5000); // give module time to send SMS
SIM900power(); // turn off module
}

i hope find solution

Do not hijack. Thread split.