What's causing my GPS to send bad packets?
Well, it's sending good packets, but the Arduino is too busy doing other things (pressure library) to watch the GPS characters come in. It's all because SoftwareSerial
is a CPU hog. Other libraries, like AltSoftSerial (works on fewer pins), or the recent gSoftSerial would be better choices.
Do you really need to receive GPS while you're getting a pressure reading? Why not read GPS for two seconds to get a fix, then stop it and get the pressure reading. Stop the pressure interface and start the GPS again. Rinse and repeat.
I'll also throw in my obligatory pitch for NeoGPS. If nothing else, the examples show a different program structure that would help immensely... you may be able to take the pressure reading during the GPS quiet time, without stopping and starting the GPS and pressure interfaces.
jremington:
Avoid use of Strings
Are you bashing String again? Sad. Oh wait, I also recommend staying away from String. @Codehawk, You'll thank us later.
Cheers,
/dev