Arduino and MaxMsp’s Serial Communication
Written by viola on 二月 19th, 2008*Reading Arduino’s Serial.print(data) in MaxMsp
Example:
In Arduino, we can turn on the serial monitor to print out the values. However, how can we keep monitoring the values in MaxMsp? J Let’s try.
Arduino:
Set the value and use the function Serial.print();
Serial.print(” “); //This will create a space between each value.
Serial.printl(); //This start a new line for vales.

MaxMsp:
Using “metro” object to start printing the values.
Using “serial” object to read and receive data from serial port.
Using “itoa” object to translate the integer to ASCII characters?
Using “print” object to get the same monitor effect as Arduino
What’s the difference between Arduino’s Serial Monitor and Max?
1. In Arduino, the value ,168, is printed on one line. In Max, each character is printed on a line so 168 prints on three line.
2. In Max, Serial.print(” “); is printed as a empty line.
For example:
aread:
3. In Max, Serial.printl(); is printed as two empty lines.
For example:
aread:
aread:
Thoughts:
The above example helps me to know what the serial port is reading when I use MaxMsp to give my Arduino port some information.
Thanks Liubo

20
上午
Wow, I’ve always wanted to learn MaxMsp, but the structure seems too complicated to me. Can you please teach me how to use it?
11
上午
Yeah!! (Wrings hands)! Nice blog you have here. I’ve enjoyed much reading your last posts. Keep it that way.