User Manual

Please note that this script does not do multi-tasking. If a sequence is running, the script will not
detect other button presses until the sequence is done. It is possible to make the buttons operate
independently, but the script would need to be much more complicated. Depending on how skilled you
are at writing scripts, you might prefer to use multiple Maestros instead.
Long delays
The longest delay possible with the DELAY command is approximately 32 seconds. In some cases,
you will want to make delays much longer than that. Here is an example that shows how delays of
many seconds or minutes can be accomplished:
It is easy to write subroutines for delays of hours, days, weeks, or whatever you want. Keep in mind,
however, that the timer on the Micro Maestro is not as accurate as a stopwatch – these delays could
easily be off by 1%.
Digital output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Moves servo 0 back and forth, with a delay of 10 minutes between motions.
begin
4000 0 servo
10 delay_minutes
8000 0 servo
10 delay_minutes
repeat
# delay by a specified number of seconds, up to 65535 s
sub delay_seconds
begin dup while # check if the count has reached zero
1 minus 1000 delay # subtract one and delay 1s
repeat
drop return # remove the 0 from the stack and return
# delay by a specified number of minutes, up to 65535 min
sub delay_minutes
begin dup while
1 minus 60 delay_seconds # subtract one and delay 1min
repeat
drop return # remove the 0 from the stack and return
?
Pololu Maestro Servo Controller User’s Guide © 2001–2017 Pololu Corporation
6. The Maestro Scripting Language Page 84 of 99