Scripting language

hi
we’re using the Mini Maestro 24 Channel board.
we want to use the maestro scripting language in order to make our robot do certain things and in general get a bit more control over the servos we use.
we looked at the documentation but it doesn’t have enough examples to help us understand what’s going on.

for example, if we want to set all the servos’ position using “get position” -
we’d us a loop running over all the servos reading the position(using “get_position” command) and then setting the target( using “servo” command)

but it’s a little unclear to us how to do that ? :slight_smile:

thanks!!!

Hello.

It is not clear from your description what you are trying to do with your script, but if you have not seen it already, you might find the “Example Scripts” section of the Maestro user’s guide helpful. For an example of using the GET POSITION and SERVO commands together, I suggest looking through the “Using an analog input to control servos” heading.

If you try writing your own script and continue having problems, you can post what you have so far and a description of what you want it to do, and I will be glad to take a look.

-Brandon

hi Brandon, thanks for the reply!
we’ll try to clarify what we want to achieve - we’re using an arduino nano board & mini maestro 24 channel to control a robot with 19 servo motors.
we send serial commands from the arduino board to the maestro board which in turn calls a sequence of frames to move the servo motors.
our current goal is to know when a sub-sequence in our script is done so we could move on to the next step.
we’ve tried using “get script status” but, since the WHOLE script is still running, it still returned “1” even after our sequence has ended.

is there a way to get a sub-sequence’s status from the maestro? or a way for us to know if any servo motor is still moving?

thanks,
Omry and Ofec

Thank you for the clarification. It sounds like you are using the “Restart Script at Subroutine” command to call your sequence of frames on the Maestro. Please note that when using the “Restart Script at Subroutine” command, it is recommended that your subroutines either contain infinite loops or end with a QUIT command (e.g. they should not end in a RETURN command since there is no place to return to). Since you are using the “Get Script Status” command to determine when the subroutine has ended, you should probably be ending each subroutine with a QUIT command. Also, it sounds like you are confused on how the “Get Script Status” command works. This command should return 1 when the script is finished or if it is stopped and return 0 if the script is currently running. If this does not help you solve the problem, I recommend posting your script here, and I would be happy to take a look.

-Brandon