User Manual

Pololu protocol: 0xAA, device number, 0x22
This command sends all servos and outputs to their home positions, just as if an error had occurred.
For servos and outputs set to “Ignore”, the position will be unchanged.
Note: For servos marked “Off”, if you execute a Set Target command immediately after
Go Home, it will appear that the servo is not obeying speed and acceleration limits. In
fact, as soon as the servo is turned off, the Maestro has no way of knowing where it is,
so it will immediately move to any new target. Subsequent target commands will function
normally.
5.f. Serial Script Commands
The Maestro has several serial commands for controlling the execution of the user script.
Stop Script
Compact protocol: 0xA4
Pololu protocol: 0xAA, device number, 0x24
This command causes the script to stop, if it is currently running.
Restart Script at Subroutine
Compact protocol: 0xA7, subroutine number
Pololu protocol: 0xAA, device number, 0x27, subroutine number
This command starts the script running at a location specified by the subroutine number argument.
The subroutines are numbered in the order they are defined in your script, starting with 0 for the first
subroutine. The first subroutine is sent as 0x00 for this command, the second as 0x01, etc. To find
the number for a particular subroutine, click the “View Compiled Code…” button and look at the list
below. Subroutines used this way should not end with the RETURN command, since there is no place
to return to — instead, they should contain infinite loops or end with a QUIT command.
Restart Script at Subroutine with Parameter
Compact protocol: 0xA8, subroutine number, parameter low bits, parameter high bits
Pololu protocol: 0xAA, device number, 0x28, subroutine number, parameter low bits, parameter
high bits
This command is just like the Restart Script at Subroutine command, except it loads a parameter on to
the stack before starting the subroutine. Since data bytes can only contain 7 bits of data, the parameter
must be between 0 and 16383.
Pololu Maestro Servo Controller User’s Guide © 2001–2017 Pololu Corporation
5. Serial Interface Page 58 of 99