Class NidecBrushless
java.lang.Object
edu.wpi.first.wpilibj.MotorSafety
edu.wpi.first.wpilibj.motorcontrol.NidecBrushless
- All Implemented Interfaces:
Sendable,MotorController,AutoCloseable
Nidec Brushless Motor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddisable()Disable the motor.voidenable()Re-enable the motor after disable() has been called.doubleget()Get the recently set value of the PWM.intGets the channel number associated with the object.Returns a description to print when an error occurs.booleanCommon interface for returning if a motor controller is in the inverted state or not.voidinitSendable(SendableBuilder builder) Initializes thisSendableobject.voidset(double speed) Set the PWM value.voidsetInverted(boolean isInverted) Common interface for inverting direction of a motor controller.voidStop the motor.Methods inherited from class edu.wpi.first.wpilibj.MotorSafety
check, checkMotors, feed, getExpiration, isAlive, isSafetyEnabled, setExpiration, setSafetyEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj.motorcontrol.MotorController
setVoltage, setVoltage
-
Constructor Details
-
NidecBrushless
Constructor.- Parameters:
pwmChannel- The PWM channel that the Nidec Brushless controller is attached to. 0-9 are on-board, 10-19 are on the MXP portdioChannel- The DIO channel that the Nidec Brushless controller is attached to. 0-9 are on-board, 10-25 are on the MXP port
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable
-
set
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.
- Specified by:
setin interfaceMotorController- Parameters:
speed- The speed value between -1.0 and 1.0 to set.
-
get
Get the recently set value of the PWM.- Specified by:
getin interfaceMotorController- Returns:
- The most recently set value for the PWM between -1.0 and 1.0.
-
setInverted
Description copied from interface:MotorControllerCommon interface for inverting direction of a motor controller.- Specified by:
setInvertedin interfaceMotorController- Parameters:
isInverted- The state of inversion true is inverted.
-
getInverted
Description copied from interface:MotorControllerCommon interface for returning if a motor controller is in the inverted state or not.- Specified by:
getInvertedin interfaceMotorController- Returns:
- isInverted The state of the inversion true is inverted.
-
stopMotor
Stop the motor. This is called by the MotorSafety object when it has a timeout for this PWM and needs to stop it from running. Calling set() will re-enable the motor.- Specified by:
stopMotorin interfaceMotorController- Specified by:
stopMotorin classMotorSafety
-
getDescription
Description copied from class:MotorSafetyReturns a description to print when an error occurs.- Specified by:
getDescriptionin classMotorSafety- Returns:
- Description to print when an error occurs.
-
disable
Disable the motor. The enable() function must be called to re-enable the motor.- Specified by:
disablein interfaceMotorController
-
enable
Re-enable the motor after disable() has been called. The set() function must be called to set a new motor speed. -
getChannel
Gets the channel number associated with the object.- Returns:
- The channel number.
-
initSendable
Description copied from interface:SendableInitializes thisSendableobject.- Specified by:
initSendablein interfaceSendable- Parameters:
builder- sendable builder
-