Has anyone figured out how to use the max [serial] object to communicate with arduino?
Gabe
Has anyone figured out how to use the max [serial] object to communicate with arduino?
Gabe
its actually very simple, but you need to make sure you have the serial usb drivers installed first. are you using a mac or a pc? i'll post up my patch over the weekend for you.
I'd definitely like to see a patch that uses connection between Max and arduino.
I had a bit of trouble actually getting the serial object to read the incoming data. I found out that (on OSX Panther anyway) two applications cannot access the serial port at the same time, so i had to close the arduino IDE.
I wrote a very simple program to send data back to max:
printInteger(i);
printNewline();
i++;
I should be seeing a simple incrementing count. It's what shows up in the arduino serial inspector, but max returns different data. I can tell that it's related to the count, but this is how it looks:
data: 49 51 53 48 10
data: 49 51 53 49 10
data: 49 51 53 50 10
data: 49 51 53 51 10
data: 49 51 53 52 10
data: 49 51 53 53 10
data: 49 51 53 54 10
data: 49 51 53 55 10
data: 49 51 53 56 10
data: 49 51 53 57 10
data: 49 51 54 48 10
I (sort of) figured it out; the [serial] is returning the numbers being sent to it, but in ascii by place!
int: 305
ascii: 51 48 53 10
int: 306
ascii: 51 48 54 10
I think 10 is the newline ascii code?
Gabe
OK, sorry for not RingTFM and for pretty much blogging in this thread.
I realized that the answers to my questions were only two clicks down from the arduino front page in the reference section.
(I'll start a new thread so people dont have to read down this far)
Gabe