GPS navigation with UNO & EM406

Can anyone please help me with the following sketch that uses an EM406 GPS module & an Arduino UNO.

I am not getting any data from the GPS. I am trying to get current latitude & longitude readings, and to see them on the serial monitor.

Thanks.

#include <NewSoftSerial.h>

#include <nmea.h>

#undef round

// create a GPS data connection to GPRMC sentence type

NMEA gps(GPRMC);

NewSoftSerial nss(2, 3);

void setup()

{

Serial.begin(115200);

nss.begin(4800);

}

void loop()

{

if (Serial.available() > 0 ) {

// read incoming character from GPS

char c = Serial.read();

// check if the character completes a valid GPS sentence

if (gps.decode(c)) {

// check if GPS positioning was active

if (gps.gprmc_status() == ‘A’) {

Serial.print("Home lat: "); Serial.print(gps.gprmc_latitude());

Serial.print("Home lon: "); Serial.print(gps.gprmc_longitude());

}

}

}

}

Perhaps it would help you to know that your reads are reading the hardware serial port, not the soft serial port?

Try

if (nss.available())…

and

c = nss.read();

Thanks for your comment.

I have solved the problem.

I was also caught out by conflicts between the standard servo library & newsoftserial.

Now I am using PWMservo & newsoftserial successfully.