I am starting to plan a project that will use amongst other things, two servos. I have not purchased a contoller board yet. I am most attracted to Arduino, due to the community as well it's value and flexibility.
My question is this: How possible is it at the current stage of development to use MaxMSP to control the Arduino's outputs to drive servos and other motors? Has anyone had any success with this? I notice the Arduino2Max patch has no stated output control- will this change at any point?
Let me know if anyone has any feedback or suggestions!
you could download and install SimpleMessageSystem, it will do what you need. It allows you to send a value to the Arduino easily. That value could be your servo position.
Thank for your reply Daniel, that's what I needed to know. It will take me a bit to get my head around SimpleMessage System, but it's good to know it can be done!
I think TOF includes a sample MAX patch in Arduino2Max, so it should be easy to figure out.
Alternately, you could send raw values over the port by using the seiral object in Max and then checking for them in the Arduino code with Serial.available().
I was under the impression that Arduino2MAX didn't support outputs yet? Is this not true?
SimpleMessageSystem supports outputs.
Arduino2Max is just a really basic max patch that uses SimpleMessageSystem.
If I recall correctly, TOF includes a max patch that does do outputs to the Ardunio, in the SMS distribution.
So you have lots of choices:
- You could use the max patch TOF distributes with SMS, or
- You could just use SMS by itself to send data to the Arduino, or
- You could just use the serial object in Max to send and receive data to/from the Arduino, and then on the Arduino end you could use the Serial.available() and similar commands to do the talking, or
- You could modify the max patch in Arduino2Max to do what you want.
Hope this helps
I made recently just a patch for max/msp for controlling servos ...
on Arduino side i developed code to have some sort of a simple message system in the style
"A 12 34 56 78 !"
where a "call-handler" is called eg: A -> your_function_A
the "parameter" values are given in the array ValN[0...9], Number of values in PosN
Servos a controlled by ServoPWM[0 ... N] and the RefreshServo function will be called every 20ms
something still to do:
- there is some flickering delayMicroseconds its not stable while serial comunication
- for every servo max 2500microseconds are used within 20ms, so theoretical max 8 servos could be controlled ( i never tried that so maybe 5 is maximum i guess)
- it would be really cool to use a ISR routine with masked timer interupts to controll a bunch of servos at once (I dont like delay)
you can find it here (in parts and pieces):