Parsing Data in Processing thru Serial Port from Arduino + Pixy Cam

Hi mck.sanderson,

First can you please format your code?
You can see how to do it here: Guidelines—Tips on Asking Questions

Also, try to avoid posting picture of data because we can’t copy/paste them to use them.

Now for your question, splitToken should work nice in your case. You can split using the space as the delimiter and just take the value 3, 5, 7, 9, 11, 13, 15

Try the code below:

void setup() {
  String myText = "block 0: sig: 1 x: 252 y: 134 width: 8 height: 3 index: 209 age: 8";
  String[] splitText = splitTokens(myText, " "); 
  println(splitText[3], splitText[5], splitText[7], splitText[9], splitText[11], splitText[13], splitText[15]);
}
1 Like