Run a script while serial commands + limit sensor management

Hi everybody,
sorry for my strange english, i’m not one.

I control a 6 servo board with Max/Msp (max4live), and i want to manage 2 limits sensor, but I wish to use a script inside the card for that, and not with the computer. Is it possible ?

something like that, very simple : When the sensor (simple push buton) is ON on channel, lets say 2, the servo in channel 1 cannot go to the range 1500-2304.

Is it possible to make that with a script with priority on the serials commands ?

Thank you (and thanks mr pololu for thoses amazings products !! so easy to manage !)


I am a little confused on what you mean by limit sensor. Could you elaborate on what it is?

The Maestro can be used without a permanent USB connection. You can refer to the Enter a Script section of the Maestro User’s Guide.

The “Using a button or switch to control servos” Example Script might be a good starting point for the script you are proposing.

You can send serial servo commands while the script is running. If you are trying to prioritize serial servo commands over a script, you might try using the get_position command to see if the servo moved via serial servo commands and not have the script move the servo.

- Jeremy

Hi Jeremy, thx for reply

sensor limit is a Google translation for "capteur de fin de course"
I’m driving 2x 360 servos for pulling things in a theatre show.
I want put a sensor on each end to avoid crash.
the motors are driven by max/msp in ableton live to be synchronized with light and music.
I can manage the stop on sensor with my max patch, but maybe is more secure if its managed by th maestro card, don’t you think ?
is it more clear for you ? My language is limited, sorry.

Thank you for the clarification. It might be better to read the sensors with the Max Patch, and exclusively use serial commands to move the servos and eliminate the need for scripts. This way there isn’t a need for making one a priority, since it will all be controlled by a single controller.

- Jeremy