Calling a script from Arduino and Maestro

Hi there

Iam pretty new to the maestro, and im using an arduino and the maestro.The idea is to make a remote control, so when i press something on the keyboard, it automatically call a certain subroutine. After reading this forum I found the “the restart script at subroutine” and Im having some trouble to use it. is the code is something to be written in the arduino to call the subroutine in the maestro or is it to call the subroutine that was in the arduino? Can someone help me ? an example code would be great ! :stuck_out_tongue:

Thanks before

Johann

Hello,

Did you read about the command in the User’s Guide? Here is what it says:

It is a subroutine defined in your script. That is not an easy command to use, so I recommend starting with something simpler, such as the Set Position command that we have an example for. If you get that working with your Arduino setup, it should be easy to change your code to use any of the commands.

-Paul

Hello Paul,

Thanks for your reply, yes I have read the user guide but I couldn’t find an example on how to use it…
and I also have tried to use the Set Target command from my Arduino, and it works great! But the troubles are those servos aren’t running simultaneously (that’s why I need to call the script)…I’ve also been thinking to use the Set Multiple Targets command to make them running simultaneously if I press a certain button, but again I stuck at how I can specify which servo are running, for example i want servo 1 and servo 4 running, while the others are idle…so can you help me ? or maybe there are other simpler option that you know ?

Thanks a lot

Johann

Hello,

If you send two Set Target commands sequentially from your Arduino, the two servos should start moving almost simultaneously (within a few tens of milliseconds), so you are probably doing something wrong, and making your system more complicated (with Set Multiple Targets or with a script) is not a good way to solve the problem. Please try simplifying your code to the simplest possible version that does not work as expected, and post the code here!

-Paul

Hi Paul,

Thanks for your reply, things are working well now cause apparently I made a very stupid mistake, I forgot to remove some delay…and Ive already get the restart script working also

Thanks to you

johann

Hello,

I am glad that you got it working!

-Paul