XML Feeds

.

[maxmsp] Arduino, Max MSP & serial data

Patrick Delges pdelges at radiantslab.com
Mon Dec 10 07:26:27 MST 2007


On 9 déc. 07, at 23:16, Joe Bicker wrote:

> I'd like to send more than one byte. Mainly to control more than one 
> servo, but also to possibly increase my precision (I have a range of 
> about 2550 with the servo, but sending serial bytes means I have to 
> multiply the input number by ten, so my resolution is actually lower).

If you need to send more than one byte, just send them in one message 
(look at the [serial] help file). You will have to parse them in the 
arduino.
Don't forget the arduino's pwm outputs have a 10 bits resolution, which 
gives only 1024 different values.

> In order to do this, I figure I need to have some sort of handshaking 
> going on (getting the arduino to "ask" for the next byte). I'm very 
> aware of the Serial.print function in the arduino code but the serial 
> object in max seems to ignore it until I send it a bang.

Indeed, [serial] has to be polled regularly with [qmetro] or whatever 
to get the received bytes. Note that on the Arduino side, you also have 
to poll the serial port.

If you need some kind of interruption, you could receive messages from 
the arduino using the MIDI protocol (it works nicely, you only need a 
220 ohm resistor :-)


_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl
http://www.crfmw.be/max




More information about the maxmsp mailing list