Ok one last comment. You code may seem to work ok, but as far as I'm concerned you've got a serious logic error given the following code:
//GPS
while (Serial3.available() > 0)
{
gps.encode(Serial3.read());
}
if (gps.location.isUpdated())
{
latitude = (gps.location.lat() , 8);
longitude = (gps.location.lng(), 8);
}
else if (gps.speed.isUpdated())
{
vel = (gps.speed.mph());
}
else if (gps.time.isUpdated())
{
hourdata =(gps.time.hour());
mindata = (gps.time.minute());
secdata = (gps.time.second());
}
First off, do you see that you're only updating the speed if the location doesn't change? And that you don't update the time unless both the location and the speed don't change?
Let's say I'm using this code in a logger in my car driving down the freeway at 60mph. Wouldn't you expect the location to change every update period? And that my speed might not be constant?
I'd think the only reason you'd get the correct speed and time logged is if the GPS transmitted multiple sentences each update period and the location (and speed) was static in all of them. And I think by default most GPS's do transmit different sentences, each possibly with the same data so maybe this really does work.
But the logic is flawed and is really a bad example for anyone to use.
Anyways do you see my point? I can't believe that any example used that exact if/elseif structure but maybe I'm just confused.
Regards,
Brad
KF7FER