Button control script

soooo new to this and need some help

relatively easy for the experienced but for me not soo much. I have been able to wire everything up and it works electrically but not sure where how to proceed. i am wanting to just basically have a button press and it run a frame created from maestro control center and wait for another button press and then run a second frame and then wait for button press and go back to the first frame. basically set up to press a button and servos will open a panel and you press the button again and the servos will close the panel and continue this process basically in a loop.

Hello.

To tell the Maestro what to do when the button is pressed, you will need to write a script. There are a few ways you can go about doing that at this point; did you already use the sequencer in the Maestro Control Center to set up the two frames you want your servos to move between? If so, you can use the “Copy All Sequences to Script” button to generate a subroutine for each one and use that as a starting point. Otherwise, it might be easier to just write your script from scratch since it’s only two positions. I 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” section of the Maestro user’s guide to get an idea of what the script might look like (the first one has some extra considerations for debouncing that makes it look more complicated and might not be necessary in your application).

If you need more specific help with writing your script, could you post a copy of your Maestro settings file? You can save a copy of your Maestro settings file from the “File” drop-down menu of the Maestro Control Center.

Brandon

here is where I am currently at. i can get the open sequence to work on button press but it does not seem to go to the close sequence and seems to just stop in the open position.
maestro_settings.txt (5.5 KB)

got it to work. as i wanted. had to play with the wait for button press command and had it in the wrong places.

thank you for your help.

1 Like

I am glad to hear you got it working! Thank you for letting us know.

Brandon