I’m having a bit of a brain teaser here, trying to sort out how to send PWM controls to multiple Arduino pins. As a start I thought I’d make a Max patcher to send the 3 pin control info and the ASCII n symbol to interface with this Arduino tutorial sketch using an RGB LED: http://arduino.cc/en/Tutorial/ReadASCIIString

I’m having trouble figuring out how to follow the 3 data values with the ASCII n (line feed/newline) code. Any suggestions?

Thanks for the reply. The Arduino code is in the link in the original post. I’ll attach it below, for convenience.

I’m wanting to send the 3 control data bytes from Max rather than from the Arduino IDE serial monitor, as the sketch is set up for (3 binary bytes (0-255) comma or space separated, followed by ASCII 10). My (unsuccessful) Max patch is pasted below. I have no trouble sending the binary bytes successfuly by themselves, but getting them to be followed by the ASCII new line is where I’m getting hung up. Also, I’m not too worried about sending/receiving the data back from Arduino to Max – that part will be discarded as soon as I get the patch working.

Thanks,

Steven

Max patch:

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.

I just realized I posted the wrong version of my Max patch…and In doing so, I think I’ve sorted out the issue – but I don’t have my Arduino here, so can’t test it until tomorrow. So, I’ll wait to resend the correct version of the patch until I’ve had a chance to try it out tomorrow.

I’m actually trying to get this going with a pixel strip and seem to be running into the same trouble. I’m using a modified version of Steven’s patch and the GraphASCII code from Tom Igoe. I can pass variables to control pixel #, r, g, and b fine in the serial monitor and additionally, can control single variables from Max, but I’m having trouble passing the whole string. If anyone had any suggestions I’d be grateful.

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.