NidecBrushless

class wpilib.NidecBrushless(pwmChannel, dioChannel)[source]

Bases: wpilib.SendableBase, wpilib.MotorSafety, wpilib.interfaces.SpeedController

Nidec Brushless Motor

Parameters:
  • pwmChannel – The PWM channel that the Nidec Brushless controller is attached to. 0-9 are on-board, 10-19 are on the MXP port
  • dioChannel – The DIO channel that the Nidec Brushless controller is attached to. 0-9 are on-board, 10-25 are on the MXP port
disable()[source]

Disable the motor. The enable() function must be called to re-enable the motor.

enable()[source]

Re-enable the motor after disable() has been called. The set() function must be called to set a new motor speed.

free()[source]

Free the resources used by this object.

get()[source]

Get the recently set value of the PWM.

Returns:The most recently set value for the PWM between -1.0 and 1.0.
Return type:float
getChannel()[source]

Gets the channel number associated with the object.

Returns:The channel number.
Return type:int
getDescription()[source]
Return type:str
getInverted()[source]
Return type:bool
initSendable(builder)[source]
pidWrite(output)[source]

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

Parameters:output (float) – Write out the PWM value as was found in the PIDController
set(speed)[source]

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.

Parameters:speed – The speed value between -1.0 and 1.0 to set.
setInverted(isInverted)[source]
stopMotor()[source]

Stop the motor. This is called by the MotorSafetyHelper object when it has a timeout for this PWM and needs to stop it from running. Calling set() will re-enable the motor.