Mem,
Excellent feedback as always. I'll remove the streaming << examples in the next iteration.
The callback idea is a very good one, but what would you think of instead changing "gps << c" to "gps.encode(c)" and having the encode method return a boolean indicating whether or not a valid sentence had just been processed? You'd then write code like:
while (afss.available())
{
if (gps.encode(afss.read()))
{
... process gps data here
}
}
I think that that would be more palatable to a beginner. Can you think of a situation where the callback would be preferred to this?
Thanks for the feedback.
Mikal