// #include <TinyGPSPlus.h>
#include "NMEA.h"
// TinyGPSPlus gps;
float latitude;
float longitude;
// Creates a GPS data connection with sentence type GPRMC
NMEA gps(GPRMC);
void setup() {
Serial.begin(9600);
Serial2.begin(4800);
Serial.println("Data received from GPS Fake:");
}
void loop() {
while (Serial2.available() > 0)
if (millis() > 5000 && gps.charsProcessed() < 10)
{
Serial.println(F("No GPS detected: check wiring."));
while (true);
}
}
// void displayInfo()
// {
// Serial.print(F("Location: "));
// if (gps.location.isValid()){
// Serial.print("Lat: ");
// Serial.print(gps.location.lat(), 6);
// Serial.print(F(","));
// Serial.print("Lng: ");
// Serial.print(gps.location.lng(), 6);
// Serial.println();
// }
// else
// {
// Serial.print(F("INVALID"));
// }
// }
// void updateSerial()
// {
// delay(500);
// while (Serial.available())
// {
// Serial2.write(Serial.read());//Forward what Serial received to Software Serial Port
// }
// while (Serial2.available())
// {
// Serial.write(Serial2.read());//Forward what Software Serial received to Serial Port
// }
// }