PWMMotorController

class wpilib.PWMMotorController(name: str, channel: SupportsInt | SupportsIndex)

Bases: MotorController, MotorSafety, Sendable

Common base class for all PWM Motor Controllers.

Constructor for a PWM Motor Controller connected via PWM.

Parameters:
  • name – Name to use for SendableRegistry

  • channel – The SmartIO channel that the controller is attached to.

addFollower(follower: wpilib._wpilib.PWMMotorController) None

Make the given PWM motor controller follow the output of this one.

Parameters:

follower – The motor controller follower.

disable() None
enableDeadbandElimination(eliminateDeadband: bool) None

Optionally eliminate the deadband from a motor controller.

Parameters:

eliminateDeadband – If true, set the motor curve on the motor controller to eliminate the deadband in the middle of the range. Otherwise, keep the full range without modifying any values.

getChannel() int
getDescription() str
getInverted() bool
getThrottle() float
getVoltage() wpimath.units.volts

Gets the voltage output of the motor controller, nominally between -12 V and 12 V.

Returns:

The voltage of the motor controller, nominally between -12 V and 12 V.

setInverted(isInverted: bool) None
setThrottle(throttle: SupportsFloat | SupportsIndex) None
stopMotor() None