#MAX MSP PATCH SERIAL#
Serial.write() writes binary data to the serial port. Serial.write() object will help you to simplify your patch. If you do not want to have a bunch of objects after serial object, there is a way you can send byte data directly.
![max msp patch max msp patch](https://kavi9999.files.wordpress.com/2010/03/picture-51.png)
Serial Communication with Serial.wirte() in Arduino To convert data for number box in Jitter, “itoa” (intiger to ASCII), and “fromsymbol” objects are needed.Ģ. Then you need to have “zl group” object to combine individual characters to make one completed data like 1024, (sum of 1, 0, 2, and 4). So, if you want to use Serial.println() method in Arduino to send number range from 0 – 1024, you need to distinguish data using “select 10 13” object : read from new line till get a return.
![max msp patch max msp patch](https://i.ytimg.com/vi/X2yJN2qZ-fQ/maxresdefault.jpg)
fromsymbol object convert ASCII into number, which can be suitable in the number box. Then, itoa is an object to convert intiger to Ascii code. So, zl group will help you to group the separated character information as one data. It means, after a new line (10) till return(13), Max/ MSP will receive a several ASCII code information, like (10) 49 48 50 52 (13) for 1024. Once it recognizes that it received a new data, it will group the information. As using println() method, we can detect the new line and return to distinguish new data. Where we need to look carefully is from select 10 13. If you are using Serail.println() method in Arduino, you will need to have the patch like below. However, since Max/MSP receives the data as ASCII format, it requires some conversion of data.
![max msp patch max msp patch](https://martinchungmusic.files.wordpress.com/2014/12/screen-shot-2014-12-09-at-10-57-36.jpg)
In this case, the sensor value can be expressed between 0 -1024. As using Serial.println() method, we can send a data as an intiger format.