The TinyGPS library updates the internal state when a line has been fully received. The user code just pushes characters into the object, like so:
Is there a library that provides just this feature, working like this:
Code:
#define RXPIN 3
#define TXPIN 2
SoftwareSerial nss(RXPIN, TXPIN);
void loop()
{
while (nss.available())
{
int c = nss.read();
if (gps.encode(c)) // <---- this is what I mean by "pushing characters into the object"
{
// process new gps info here
}
}
}
- create a "line receiver" object and give it a callback to use when a line is complete
- push in received characters