Model railroad turnout script

There is an example under the “Using multiple buttons or switches to control servos” heading of the “Example Scripts” section of the Maestro’s user’s guide that you might find very useful as a starting place. If you use a script like the one you posted above, the Maestro will be stuck waiting for a specific button to be pushed and not respond to the other buttons. Also, I recommend starting with getting two servos working, which can be much different than having just one servo; after you have two working, it should be much easier to add more. It seems like you might need the Maestro to react differently when the same button is pushed, based on the servo’s current position. You might try doing this by using the “GET_POSITION” command. Alternatively, you could have a state variable associated with each button. This method could be much more complicated. An example script for using a state variable with one button can be found in this post.

If you try making a script that works with two buttons and servos and have questions or problems, you can post the code here, and I would be happy to help.

-Brandon