@JackD12 - Glad to be of help. The community deserves the thanks, really. I have been learning quite a lot and still not be doing things very efficiently. I like to get things working first, then look for improvements. If I can optimize on the way, great.
Do you have future plans for your project? Maybe share a bit more of this in the #project-share part of the forum?
If you need or want another task, we used a bunch of Strings that could potentially lead to heap fragmentation and ultimately lead to sporadic resets/panics. At your leisure, you can read some other posts about heap fragmentation and improve that section of code.
There is more than one way to pull lat and long out of the serial stream of data.
- Use a fixed length character buffer to collect the data via Serial
- Upon discovery of the line feed parse the buffer
- Send that information on to where it needs for the robot to do its work
- Empty the buffer for the next lat/lon
If you are happy with the way it is, that is just fine too. Programming is a puzzle that keeps on giving (and taking at times). If you do take on this task, make a backup of your current code since it is working This way, you can always go back to a known working version.