Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 8 months ago.
Magnetometer Parsing: OS5000 Series,
Hello.
I am currently working on a project that involves tactile-feedback land navigation. On the navigation side, I am correctly running a NMEA GPS parser. However, I'd like to parse a Magnetometer (OS5000) in tandem. I am having a terrible time trying to understand mbed string parsing. The cookbook had GPS libraries for me to choose from. No such luck for the OS magnetometer.
This is an example sentence: $C253.7P-5.4R179.5T25.0
This is the format type (although I could potentially swap to another format type): Format Type 0x01, 1(10): “$C” format $Chhh.hPpp.pRrr.rTtt.t
"Hhh.h Heading in degrees, corrected for Declination if one is entered Ppp.p: Pitch angle, “P” precedes the pitch angle in degrees Rrr.rr Roll angle, “R” precedes the roll angle in degrees Ttt.t: Temperature of the compass board"
manual is here (page 12 is sentence information): http://www.ocean-server.com/download/OS5000_Compass_Manual.pdf
Can someone give me an idea how to search the serial input for the lead characters, then store each variable (heading, pitch, roll)?
And will I run into issues having two serial inputs (I think not because each serial input has separate handles)?