Forums > MaxMSP

Simple serial data patch

January 28, 2012 | 4:21 am

I’m looking to build a simple patch that reads serial data from an Arduino.
I’d like a bang when the serial data reads 0.
My arduino is outputting 1′s and 0′s on usbmodem1d11.
Can someone help me with this code?


January 28, 2012 | 9:45 am

In the Arduino IDE, go to: File->Examples->Communication->VirtualColorMixer

That’s got a basic Max patch you can copy and open from the clipboard. If you want a bang when it reads a zero, look at the [select] object.


January 28, 2012 | 1:54 pm

Thanks. That looks at arduino’s analogue inputs though, right?
I’m not having any luck receiving the serial data from the arduino. If I monitor the serial port via the arduino IDE then I get a string of 1′s and 0′s, but i can’t seem to display them in max.


January 28, 2012 | 8:29 pm

This is coming along nicely.

I’m getting very close to it functioning just as it should.

It’s reading serial data and detecting a change in its output signal.

Now, this patch has four audio tracks. I would like the audio tracks to play in sequence, looping back to the first when the last one ends, unless the serial data switch opens, in which case I would like the audio track to jump to the next track, then continue to play in sequence. I’m pretty sure I’m nearly there, just a tiny bit more help would be great!

Attachments:
  1. jackarduino.maxpat

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