« fix for serial on windows maybe... | Main | Luma key patch v2, for Jorge »

Max & Arduino serial communication, new & improved, with notes

(Fixed a bug 3/26/07, so if you downloaded before, try again)

Download patch & script

Just in case you have any trouble opening the Arduino script, here it is for you to cut and paste:


//Arduino to Max example - to be used with accompanying Max patch

int incomingByte = 0; // for incoming serial data

void setup() {
Serial.begin(9600); // opens serial port, set baud rate
}

void loop() {
if (Serial.available() > 0) { // send data only when a byte is received
incomingByte = Serial.read(); // read the incoming byte
Serial.print("I received: "); // say what you got
Serial.println(incomingByte, DEC);
}
}

Comments

The patch makes a lot more sense... anyone else reading the arduino script as garbage, though? It's not opening right for me.

Not sure what the problem is with the script download, but anyway the text is now included in the post - just cut n paste.

I keep trying to get this patch up and running. Or, it is running, and I just don't know how to use it properly.

Either way, I'm still going to need a little help with this one.

OK, I tried to make it clear, but obviously it wasn't clear enough.

So now I've made it obvious. (new version replaces old).

And please try to be a bit more specific when you're having trouble.

Post a comment