Yeah, thats the way I was

Yeah, thats the way I was beginning to lean. To be honest though I just want to interpret the serial data in Max/MSP. I can convert it into midi data from there quite easily as, in contrast to my arduino programing skills, I'm quite good with Max!

The trouble is, if I print the serial data in Max it just sends out a flood of numbers that are meaningless. Values for each sensor on the 'chuck'. So I need to 'label' each of the sensors data (accelerometer z axis, accelerometer x axis... etc) within the arduino program in a way that Max can read.

Somebody asked that exact question on the arduino forums here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1134496621
and the solution appears to be to use the 'serialWrite' command. The trouble is, I'm so crap with writing arduino code that I can't figure out how to implement it into this sketch.

I'm guessing it means replacing this somehow:

Serial.print(i,DEC);
Serial.print("\t");

Serial.print("joy:"); //tag
Serial.print(joy_x_axis, DEC); //x axis value
Serial.print(","); //next value
Serial.print(joy_y_axis, DEC); //y axis value
Serial.print(" \t");

Serial.print("acc:");
Serial.print(accel_x_axis, DEC);
Serial.print(",");
Serial.print(accel_y_axis, DEC);
Serial.print(",");
Serial.print(accel_z_axis, DEC);
Serial.print("\t");

Serial.print("but:");
Serial.print(z_button, DEC);
Serial.print(",");
Serial.print(c_button, DEC);

Serial.print("\r\n"); // newline
i++;

what say you?

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is used to make sure you are a human visitor and to prevent spam submissions.
Copy the characters (respecting upper/lower case) from the image.