Hej Nako,
Let's take a look at this.
>>the project is a mixer (we are using liquids to control sounds, it is
quite nice), where we have 4 digital inputs (switches) and an analog
one (weight sensor). we have to send this 5 informations to max so
our patch can work the mixer.
The best thing to do in this case is to send all formated somehow. I always recommend to do it making the board send a character to identify the sensor, and a value following, like:
A5
B7
C2
A78
A23
B3
A22
A21
B0
C6
...
The way of doing this from the code is to send:
serialWrite('A');
printInteger(valueSensorA);
serialWrite(10);
serialWrite(13);
serialWrite('B');
...
this allows you to have different latencies for the different sensors
The way of reading this in MAX is a different story. You will have to either convert the patch we made for PureData (look at the
www.arduino.ws website for the latest version) or to wait for a couple of days until I get an update from Greg at SFU in Vancouver, who is revising this very same patch for MAX/MSP.
>>so, question: how to differentiate the serial information? how to
tell which switch is on and off and still get the weight sensor
information without scrambling everything? I imagine we have to
configure the digitalread inside max, is that it?
The way to differenciate the different sensors is using the character in the front, that allows you to distinguish between different numeric inputs to the MAX patch.
Was this of any help?
/David@Malmo