Forums > MaxMSP

arduino & serial object & max5

March 1, 2013 | 2:09 pm

my arduino code sends data to the serial object in max.

The data which I send from the arduino looks like this:
sensor x pin x 1
sensor x pin x 0
It simply tells whether a sensor is touched (1) or not (0)

In the serial monitor in arduino the data represented is accurate.
However when the data is received in max, some data seems to get ‘lost’.

Could it be that the metro object which gives a signal to the serial object is to high? (even though it is only 1)
How can I alter the program that the data is continiously read?


March 1, 2013 | 2:48 pm

To really answer this question, it would be good to see the patch & sketch you are using.


March 4, 2013 | 8:30 am

Okay, hereby the files.
The data from the arduino prints the following messages.
Serial.print("sensor");
Serial.print(sensor);
Serial.print("pin");
Serial.print(i+10);
Serial.println("1"); // 1= high or 0=low
I then use Max to process the data. In the serial monitor in arduino the data represented is accurate.
However when the data is received in max, some data seems to get ‘lost’. I think this is related to the p processing patch.
My question therefore is: How can I alter the program that the data is continiously read?

Attachments:
  1. mpr121touch.ino

March 8, 2013 | 1:37 pm

fixed it..


March 8, 2013 | 6:23 pm

Glad you got it fixed.
Could you please post how you did it, so that anyone searching for this later will know your result.

thanks,
Simon


March 11, 2013 | 1:41 pm

sadly, I only improved it. It still isn’t completely fixed.


March 11, 2013 | 1:51 pm

I am still having problems using the serial object to process the send arduino data. In the serial monitor in arduino the data represented is accurate. However when the data is received in max, some data seems to get ‘lost’, so not get through the serial object.

The data from the arduino prints the following messages, to show whether a sensor is touched or not.
Serial.print("sensor");
Serial.print(sensor);
Serial.print("pin");
Serial.print(i+10);
Serial.println("1"); // 1 when high (so touched) or 0 when low (no touch)

My question therefore is: How can I alter my program for the data to be continiously read?
Currently some sensors stay high, even though they are not touched.

Attachments:
  1. mpr121touch.ino

Viewing 7 posts - 1 through 7 (of 7 total)