static const int RXPin = 12, TXPin = 255;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);
static void smartDelay(unsigned long ms)
{
unsigned long start = millis();
do
{
while (ss.available())
gps.encode(ss.read());
} while (millis() - start < ms);
}
void setup() {
ss.begin(GPSBaud);
}
void loop() {
if (millis() > 5000 && gps.charsProcessed() < 10) {
Serial.println(F("No GPS data received: check wiring"));
}
else
{
Serial.print("Latitude : ");
Serial.println(gps.location.lat(), 6);
Serial.print("Longitude : ");
Serial.println(gps.location.lng(), 6);
Serial.print("Speed : ");
Serial.println(gps.speed.mph(), 6);
Serial.print("I : ");
Serial.println(i);
Serial.print("Satellites: ");
Serial.println(gps.satellites.value());
Serial.print("Battery VCC: ");
Serial.println(String(batVcc));
Serial.print("Time UTC : ");
Serial.print(gps.time.hour());
Serial.print(":");
Serial.print(gps.time.minute());
Serial.print(":");
Serial.println(gps.time.second());
}
}
I am not sure what the problem is, I read that there is a different SoftwareSerial for ESP8266 and I tried that and I could not get it to work correctly. Any help would be great! Thanks!