Maximum Output

The user can constrain the maximum forward and reverse percent output of the motor.

Examples

If you wanted some motor to only be able to apply 25% power in both directions, I could use the following.

motor.setMaxOutput(0.25); // sets 25% as limit for both directions

If you want some motor to have no constraint in going forward, but only 30% power in reverse, then you could use the second method overload.

motor.setMaxOutput(1, 0.3);

You could also specify a limit of 50% power going forward, and not let the motor drive in reverse.

motor.setMaxOutput(0.5, 0);

API Details

Set the maximum percent output.

setMaxOutput(double maxOutput);

Parameters

  • maxOutput The maximum absolute output in both directions in range 0 to 1.

setMaxOutput(double maxFwd, double maxRev);

Parameters

  • maxFwd The maximum forward output in range 0 to 1.

  • maxRev The maximum reverse output in range 0 to 1.

Last updated