Multiple Routines using Maestro

I am new to the maestro, and I am creating a DJ robot that in theory would run multiple pre-programmed routines when buttons are pressed. I know you can record a set of frames on the maestro and make it a show, but can you record multiple shows?


It sounds like you are talking about making your shows using the Maestro’s sequencer and then starting them with buttons connected to the Maestro. You can create multiple sequences (your shows) in the “Sequence” tab of the Maestro Control Center software, and you could select and run each sequence from there. However, if you want to be able to start your scripts with something other than the Maestro Control Center, you will need to do some scripting.

Start by deleting any existing script you have in the “Script” tab, then clicking the “Copy all Sequences to Script” button in the “Sequence” tab. Doing this will set up the script with each of your sequences in its own subroutine, so then you just need to add the logic for when to call them.

You can learn more about how scripting on the Maestro works in “The Maestro Scripting Language” section of the Maestro user’s guide. I especially recommend looking through the “Using a button or switch to control servos” and “Using multiple buttons or switches to control servos” examples in the “Example Scripts” sub-section. Also, it would probably be good for you to look over the button/switch wiring example in the “Attaching Servos and Peripherals” section before you start connecting buttons to the Maestro.

If you have trouble triggering sequences with your script, please post a copy of your Maestro settings file, and we might be able to help. You can save a copy of your Maestro settings file from the “File” drop-down menu of the Maestro Control Center.

- Patrick

Thanks for the direction, ideally my thought was to use an arduino connected to the maestro to trigger the routines, but I wasn’t even sure if the maestro could have multiple routines. I couldn’t find any videos that showed connecting an arduino to a maestro, so I figured I better see first if the maestro would work for what I am trying to do, then go from there. If I can trigger directly from the maestro that would be phenomenal. I will read through what you referenced, thanks for responding.

Thanks for clarifying that detail about your application. If you want to trigger your sequences from an Arduino, you would start the same way indicated in my previous post; use the “Copy all Sequences to Script” button in the “Sequence” tab to generate subroutines for each sequence.

From there, you could use your Arduino to start the subroutines through the Maestro’s serial interface, which you can learn about in the “Serial Interface” section of the user’s guide. The “Serial Script Commands” will probably be the most useful subsection for what you need to do. One important detail to note from that section is that the subroutines you control like this should not end with the RETURN command — instead, they should contain infinite loops or end with a QUIT command. The subroutines generated by the “Copy all Sequences to Script” button will end with a RETURN command by default, so you will still need to make some modifications to the script.

We have a Maestro Servo Controller library for Arduino that should make it easier to write the Arduino code that interfaces with the Maestro, and the README file there even has some guidance to help with the wiring.

- Patrick

Ok thanks so much.