for what is feedGPS used? in the while loop of delay theres a condition there with feedgps whats its importance? and what does the return value do?
thanks
Feed the object serial NMEA data one character at a time using the encode() method. (TinyGPS does not handle retrieving serial data from a GPS unit.) When encode() returns “true”, a valid sentence has just changed the TinyGPS object’s internal state.
gps.stats(&chars, &sentences, &failed_checksum);
This stats method provides a clue whether you are getting good data or not. It provides statistics that help with troubleshooting.
chars – the number of characters fed to the object
sentences – the number of valid $GPGGA and $GPRMC sentences processed
failed_checksum – the number of sentences that failed the checksum test
this is what they say about it but i still dont understand it
It is a kludge. The TinyGPS example program tries to do two things at once: print too much data at the wrong time, and keep the GPS input buffer from overflowing. Related thread here, with additional links.
What feedgps( ) does, is it gets the serial chars arriving from the GPS device, it gets each of those chars, one at a time, and feeds them into the gps parser object, using the encode( ) function of the gps object.
When the gps parser object gets a complete and valid "NMEA sentence", this function returns true, otherwise false.
When you get a true returned from this function, that means you have new information from the gps which you can use for whatever.