Arduino2Max frustration

Jun 24, 2007 at 9:41pm

Arduino2Max frustration

So for a couple of weeks now I have been trying to make Max talk to my Arduino. The frustration is that Max is obviously seeing the board as the red upload light flashes when i start the Arduino2Max patch. But nothing else will work. I cant receive any digital input or send any digital out.

I’m working on a Mackbook Pro with Max 4.6. As far as I know I have installed all the drivers.

I have run out of ideas about what to try next – any suggestions would be great.

Thanks

#32602
Jun 27, 2007 at 7:17pm

Are you able to get the arduino board to talk to the arduino enviroment and successfully upload code to it – this would confirm that you have all the drivers installed etc..

If you have then make sure you are not running the arduino enviroment and the max patch at the same time as the board can only talk to one at a time.

You need to configure the max patch to ttalk to the correct serial port, and at the correct speed.

Are these a ll things that you have already done?

HTH

Nick

#107637
Jun 28, 2007 at 7:00am

Thanks for the response.

Yeah Ive got Arduino working fine from the Arduino environment – load code etc all works.

I figured that I needed to quit Arduino for MAx to communicate but still no joy.

Im pretty sure I have MAX configured to the correct port as I can see the red light flick on and of whe I hit Start in the arduino2MAx patch. But nothing else happens.

But speed? I presume here you mean the baud speed rather than the metro speed controls in the setting of Arduino2MAx.Should I be changing that in the DSP Sample rate or is there something else I am missing?

Thanks for your advice.

#107638
Jun 28, 2007 at 7:24am

If you click on the serial port settings in the max patch then you get a subpatch opening where you need to configure the patch for the serial port on your machine, the serial port object should be a the correct speed if you are using the arduino file that came with it, but it is set to port e, which maynot be where it is on your machine.

In the blue section of the patch you click on the print serial ports to max window bang, and this will give you a list of devices with letters.

You then nedd to replace the letter e with the correct letter for your machien.

You also need to set the sample rate in the slider at the top of the patch to more than zero.

HTH

Nick

#107639
Jun 28, 2007 at 9:21am

We yeah thats what my feeble brain had deduced. But no joy.

I figure that I have done all that right as I can make the red Arduino light switch on but the inputs/outputs dont do anything which makes the whole thing pretty pointless unless your into making red leds blink!

Any other thoughts would be fantastic as I am just about to give up and get a MAKE control.

Thanks

#107640
Jun 28, 2007 at 9:33am

Did you try pressing the little reset button on the Arduino before
initiating Max communication?

jb

Am 28.06.2007 um 11:21 schrieb James Charlton:

>
> We yeah thats what my feeble brain had deduced. But no joy.
>
> I figure that I have done all that right as I can make the red
> Arduino light switch on but the inputs/outputs dont do anything
> which makes the whole thing pretty pointless unless your into
> making red leds blink!
>
> Any other thoughts would be fantastic as I am just about to give up
> and get a MAKE control.
>
> Thanks

#107641
Jun 28, 2007 at 9:47am

James,

i have an arduino board and got it to work with max, the thing is
that it wasn’t that easy to get it going. I eventually did everything
in processing because I had some real timing issues with the serial
communication.

If you have some time I would be more then happy to try to get it to
work again, but I have no time whatsoever this month (just two more
days)
Although I’m pretty sure the makecontroller is a nice kit I can
easily say the same of the arduino board.

Could you (maybe off list) explain me what you exactly wanne do, so I
can mimic the setting here and see if we can crack the code together?

Best Regards

Pieter

On 28 Jun 2007, at 11:21, James Charlton wrote:

>
> We yeah thats what my feeble brain had deduced. But no joy.
>
> I figure that I have done all that right as I can make the red
> Arduino light switch on but the inputs/outputs dont do anything
> which makes the whole thing pretty pointless unless your into
> making red leds blink!
>
> Any other thoughts would be fantastic as I am just about to give up
> and get a MAKE control.
>
> Thanks
>

#107642
Jun 28, 2007 at 9:52am

Well if I hadnt I have now and it hasnt made any difference.

Maybe im expecting too much. Im thinking that a push button in say digital in 7 should flash on the corresponding led on the MAX patch from r d7. or that if i switch that to be s 13 i should be able to make the led in pin 13 come on. Is that asking too much?

For now I will just sit here and switch the TX light on and off!

#107643
Jun 28, 2007 at 12:30pm

yes thats pretty much how it should work.

I would write an arduino file that flashes the leds connected to the board if you press the switch on the board, to check that all your wiring up is correct, as the messages maybe being sent, but if the wiring is wrong you won’t see a response.

Once I had confirmed that the lights and switches physically worked, move on to looking at the possible issues with the boards communication with max.

I don’t have it hooked up at present to double check, but I would expect the rx led on the arduino to be flashing at the speed that you set the sample rate (it asks the arduino board to send info each time) and the tx led to flash straight after as it replies (if the sample rate is high it will look pretty much like both leds are just on).

HTH

Nick

#107644
Jul 4, 2007 at 9:44pm

Interested to see how you’re coming as I’ve just gotten my own Arduino. I was able to get things up and running pretty well, though with a couple caveats. Hope these answer some of your troubles, though I’m not really sure what your status is at the moment.

I’m on Windows, I don’t know if that makes a difference with all this.

First: If Windows — make sure you have the updated serial object, there was a “read timeout” problem with the old one. I think it’s included in 4.6.3.

Second: You can’t have Max connected to the same COM port when you try to upload the Arduino code (you’ll see an error in the Arduino environment). Just change the port of the serial object in Max to something else before you upload, then change it back to test. This also goes for Hyperterminal or other serial-using programs you might be using. (BTW using one of these may be handy as a first step towards getting info into Max… at least you can see if your machine is getting the data, then tackle the Max-specific issues.)

Third: I had some issues formatting the outcoming data from the board—i.e., I wanted value 10, but serial would spit out “49 48″ (ASCII equivalents). The easy fix was to specify the values coming out of the board (in the Arduino code) as BYTE, so,

Serial.print(i,BYTE); // where i is the variable value you want

…then serial spits out the integer as desired.

Finally: I haven’t delved into too much in the way of potentiometers, photoresistors, switches, etc. I’m sure there’ll be more issues as I try them out. I’d be curious what you’re using the board for and what elements you’ve gotten to work. I will say that for the price this board and environment is pretty slick, particularly being USB-powered.

Here’s a mini-patch that might make setting the COM ports and reading the serial output easier:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 414 155 152 9109513 bgcolor 120 120 120;
#B color 1;
#P window setfont “Sans Serif” 14.;
#P comment 411 73 204 9109518 Speed of serial reading (ms);
#P objectname comment_num[2];
#P window setfont “Sans Serif” 18.;
#P number 413 98 59 18 20 0 1 139 0 0 0 220 28 28 222 222 222 0 0 0;
#P toggle 405 30 38 0;
#P window setfont “Sans Serif” 12.;
#P newex 309 73 94 9109516 metro 100;
#B color 1;
#P button 274 68 28 1;
#P window setfont “Sans Serif” 10.;
#P window linecount 3;
#P comment 46 116 139 9109514 Speed of output (default = 50 millisecond intervals). Settable to 1 ms.;
#P objectname comment_num[14];
#P comment 198 104 123 9109514 Serial info to drop-down menu subpatch (double-click to see);
#P objectname comment_num[13];
#P window setfont “Sans Serif” 18.;
#P number 66 163 59 18 1 0 1 139 0 0 0 220 28 28 222 222 222 0 0 0;
#P window setfont “Sans Serif” 12.;
#P window linecount 1;
#P newex 31 195 94 9109516 speedlim 50;
#B color 1;
#P window setfont “Sans Serif” 14.;
#P comment 318 182 273 9109518 < -- Raw data from board output;
#P objectname comment_num[4];
#P window setfont “Sans Serif” 24.;
#P message 193 181 115 9109528 231;
#B color 1;
#P window setfont “Sans Serif” 12.;
#P newex 193 154 94 9109516 prepend set;
#B color 1;
#P window setfont “Sans Serif” 9.;
#N vpatcher 13 88 484 450;
#P outlet 24 246 20 0;
#P inlet 24 32 20 0;
#P window setfont “Sans Serif” 12.;
#P newex 304 196 127 9109516 prepend setitem 7;
#B color 1;
#P newex 264 170 127 9109516 prepend setitem 6;
#B color 1;
#P newex 224 145 127 9109516 prepend setitem 5;
#B color 1;
#P newex 184 119 127 9109516 prepend setitem 4;
#B color 1;
#P newex 143 197 127 9109516 prepend setitem 3;
#B color 1;
#P newex 104 171 127 9109516 prepend setitem 2;
#B color 1;
#P newex 64 146 127 9109516 prepend setitem 1;
#B color 1;
#P newex 24 120 127 9109516 prepend setitem 0;
#B color 1;
#P newex 24 89 293 9109516 unpack s s s s s s s s;
#B color 1;
#P newex 24 59 93 9109516 route port;
#B color 1;
#P comment 167 235 258 9109516 Manages serial name data. Each port name (up to 8 , in this case) replaces an item in the drop-down menu of the parent patch (items in drop-down are numbered 0 – 7).;
#B color 1;
#P connect 11 0 1 0;
#P lcolor 2;
#P connect 1 0 2 0;
#P lcolor 2;
#P connect 2 0 3 0;
#P lcolor 2;
#P connect 10 0 12 0;
#P lcolor 2;
#P connect 9 0 12 0;
#P lcolor 2;
#P connect 8 0 12 0;
#P lcolor 2;
#P connect 7 0 12 0;
#P lcolor 2;
#P connect 6 0 12 0;
#P lcolor 2;
#P connect 5 0 12 0;
#P lcolor 2;
#P connect 4 0 12 0;
#P lcolor 2;
#P connect 3 0 12 0;
#P lcolor 2;
#P connect 2 1 4 0;
#P lcolor 2;
#P connect 2 2 5 0;
#P lcolor 2;
#P connect 2 3 6 0;
#P lcolor 2;
#P connect 2 4 7 0;
#P lcolor 2;
#P connect 2 5 8 0;
#P lcolor 2;
#P connect 2 6 9 0;
#P lcolor 2;
#P connect 2 7 10 0;
#P lcolor 2;
#P pop;
#P newobj 200 74 50 9109513 p sorter;
#B color 1;
#P window setfont “Sans Serif” 20.;
#P user umenu 37 229 212 9109587 1 64 257 1;
#X setrgb 12 0 214 255 255 255 255 255 255 221 221 221 170 170 170 119 119 119 187 187 187;
#X add COM1;
#X add COM2;
#X add COM4;
#X add 3;
#X add 4;
#X add 5;
#X add 6;
#X add 7;
#P window setfont “Arial Black” 14.;
#P message 31 37 63 9568270 print;
#B color 1;
#P window setfont “Sans Serif” 18.;
#P newex 31 74 161 9109522 serial d 9600;
#B color 1;
#P window setfont “Arial Black” 14.;
#P comment 105 37 290 9568270 Click to get list of serial ports;
#B color 2;
#P objectname comment_num[1];
#P window setfont “Sans Serif” 12.;
#P newex 253 233 91 9109516 prepend port;
#B color 1;
#P connect 0 0 2 0;
#P connect 3 0 2 0;
#P lcolor 2;
#P connect 13 0 2 0;
#P connect 2 0 9 0;
#P lcolor 2;
#P connect 5 0 4 0;
#P lcolor 2;
#P connect 10 0 9 1;
#P lcolor 2;
#P connect 9 0 6 0;
#P lcolor 2;
#P connect 6 0 7 0;
#P lcolor 2;
#P connect 2 1 5 0;
#P lcolor 2;
#P connect 4 1 0 0;
#P lcolor 2;
#P connect 14 0 13 0;
#P connect 15 0 14 0;
#P connect 16 0 14 1;
#P window clipboard copycount 19;

#107645
Sep 17, 2007 at 10:37pm

hi

I recently updated the Arduino2Max code…
see this link:

http://www.arduino.cc/playground/Interfacing/MaxMSP

It works great with the latest Max, a Diecimila Arduino and OSX 10.4.10.

Quote:
“Im thinking that a push button in say digital in 7 should flash on the corresponding led on the MAX patch from r d7. or that if i switch that to be s 13 i should be able to make the led in pin 13 come on. Is that asking too much?”

Yes. It doesn’t, and never did, control the ouputs. It’s only written to read the inputs.

A few more notes:

- Arduino2Max is not a commercial package, but rather it’s a free hack for using Arduino with Max. It works, but you know, there is no suppport, user beware etc. Also, you’re not allowed to be ‘frustrated’ if the product is free. It bums out those who made it free in the first place. :)

- Arduino is an experimental hardware package for artistic, education and hobby applications. As such the software and hardware are all works in progress; think of it as ‘straight from the lab’, rather than off-the-rack, or in ‘permanent beta’. It’s a hardware hacker’s platform.

- You might find that you can get more support and advice for the hardware side by going to the Arduino forum.

- There are lots of alternative packages (Pduino, Firmata) for using Arduino with Max; check this page under the heading “MAX”

http://www.freeduino.org

Hope this helps.

Daniel

#107646

You must be logged in to reply to this topic.