Copied code from the Halt command processing to a new haltMotors function.
Added SetNumberMotors command to change the number of motors being controlled.