Parsing data from pyserial

Hendrik van Rooyen mail at microcorp.co.za
Sun Dec 3 01:08:28 EST 2006


"Lone Wolf" <lone_wolf at ureach.com> wrote:

> I'm trying to get data through my serial port from a CMUcam.
> This gizmo tracks a color and returns a packet of data. The
> packet has nine data points (well, really eight since the first
> point is just a packet header) separated by spaces as follows: M
> xxx xxx xxx xxx xxx xxx xxx xxx

8<----------------------------

Try splitting the stuff on the "M" first to separate the records,
then get rid of the newlines, carriage return, linefeed, whatever,
and then use the split on whitespace...

- HTH - Hendrik




More information about the Python-list mailing list