How to read large volume of serial data

Hi all,

I'm using the Mega to read serial data sent from a compass unit. The issue is that the compass sends its status as a large block of data. Looking at the serial monitor, it's sending upwards of 200 bytes per few ms. The data is in this format:

Compass: 350 Pitch: 5 Roll: 6 Temperature: 15 ... Tilt: 15

I need to then extract only relevant information, such as the numerical integer that specifies the heading, pitch and roll. I'm sure I could buffer the data and then look at each character individually, but that seems rather computationally inefficient. Any idea how to approach this problem?

Also bear in mind that the Mega is going to be in real-time communication with a VB.NET GUI via another serial connection, so if possible I would like a method that does not interrupt this process.

Thanks in advance

String processing is one of the things I'm still lacking in C++. I look forward to whatever solution you find. Keep us posted.

The below TextString link should get you started. What you posted looks like ~50 bytes. You could wait until the buffer has >60 bytes and the capture it to a string. The info in the string may look something like below. With the various string functions you should be able to extract the desired data quite easily.

50 Pitch: 5 Roll: 6 Temperature: 15 Compass: 350 Pitch: 5 Rol

http://www.arduino.cc/en/Tutorial/TextString