the code for gps tracking fails when coupled with another program .. help me out

i am using a program to lock gps coordinates in my project, its working fine when i execute it independantly but when i combine it with other functions which i need for my project, its failing. i just cant understand the reason for the failure.

the line which fails in the gps tracking program in
if(gps.encode(gpsserial.read()));

the phrases, “inside gps”
“inside while”
“inside if”
are used only to determine the code validity.

my program goes inside while loop and its getting executed infinitely without executing the ‘if’ part. a runtime error.

please help me
1.gpscode.txt has only gps function // gps code is working perfectly
2.sample.txt is my entire project code including gpscode also. // here gpscode is not working

gps new code.txt (843 Bytes)

sample.txt (4.18 KB)

  1. you have SoftwareSerial on different pins in the two programs: SAMPLE has (2,3) and GPS_NEW_CODE has (0,1). Also, pins 0 & 1 are the Serial pins. You can’t start SoftwareSerial on hardware serial port pins, and you don’t normally hook GPS to pins 0 & 1.

  2. you start them at different baud rates: SAMPLE has 9600 and GPS_NEW_CODE has 4800.

Cheers,
/dev