Hello,
Sorry for the delay.
Please find the below code ... But no GPS data is coming.. Is there is any mistake..
#include <SoftwareSerial.h>
#include "TinyGPS.h"
SoftwareSerial gpsSerial(4, 3); //4 is for TX and 3 is for RX
TinyGPS gps; // create gps object
void setup() {
Serial.begin(115200);
gpsSerial.begin(9600); // connect gps sensor
delay(2000);
}
void loop() {
static int count = 0;
static long lat=0,lon=0;
while(gpsSerial.available()) { // check for gps data
if(gps.encode(gpsSerial.read())) { // encode gps data
gps.get_position(&lat,&lon,null); // get latitude and longitude
Serial.println(lat);
Serial.println(", ");
Serial.println(lon);
}
}
}
Thanks-
Pokhraj