New guy needs help

I’m working on a project with a pololu micro maestro, all i need it to do is turn two servos at the press of a button

I’ve never programed anything in my life and i’ve been basing everything on the example scripts from the manual but it still wont work, when i run the script the servos will do what i need to but when i disconnect it and press the button all that happens is one servo wiggles a little after 10 presses

My script looks as follows:

goto main_loop

sub button 
0 get_position 500 less_than
return

sub wait_for_button_press 
wait_for_button_open_10ms 
wait_for_button_closed_10ms 
return

sub wait_for_button_open_10ms 
get_ms
begin
button 
if
drop get_ms
else
get_ms over minus 10 greater_than
if drop return endif
endif
repeat

sub wait_for_button_closed_10ms 
get_ms
begin
button 
if
get_ms over minus 10 greater_than
if drop return endif
else
drop get_ms
endif
repeat

main_loop:
begin
368 1300 frame 
2256 1300 frame 
repeat

sub frame 
wait_for_button_press 
1 servo 2 servo

return

Is there something i’m doing wrong? Also when i plug in the batteries the yellow light blinks every second, i look in the manual but i dont quite understand if its normal or not.

Thank you!

Hi.

It sounds like you might not have your script setup to run at startup, which you would need to do in order to run the Maestro without a permanent USB connection.

You can enable this feature by checking the “Run script on startup” option on the Maestro Control Center software. More information about this can be found in the “Entering a Script” section of the Maestro user’s guide.

Also, when posting code, please use the code brackets so it displays nicely in your post. We have edited your post to include the code brackets.

- Zeeshan