class wpilib.PWMSpeedController(self: wpilib.PWMSpeedController, channel: int) → None

Bases: wpilib.PWM, wpilib.interfaces.SpeedController

Common base class for all PWM Speed Controllers.

Constructor for a PWM Speed Controller connected via PWM.


channel – The PWM channel that the controller is attached to. 0-9 are on-board, 10-19 are on the MXP port

disable(self: wpilib.PWMSpeedController) → None
get(self: wpilib.PWMSpeedController) → float

Get the recently set value of the PWM. This value is affected by the inversion property. If you want the value that is sent directly to the SpeedController, use PWM.getSpeed() instead.


The most recently set value for the PWM between -1.0 and 1.0.

getInverted(self: wpilib.PWMSpeedController) → bool
pidWrite(self: wpilib.PWMSpeedController, output: float) → None

Write out the PID value as seen in the PIDOutput base object.


output – Write out the PWM value as was found in the PIDController

set(self: wpilib.PWMSpeedController, value: float) → None

Set the PWM value.

The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value for the FPGA.


speed – The speed value between -1.0 and 1.0 to set.

setInverted(self: wpilib.PWMSpeedController, isInverted: bool) → None
stopMotor(self: wpilib.PWMSpeedController) → None