Package edu.wpi.first.wpilibj.xrp
Class XRPMotor
java.lang.Object
edu.wpi.first.wpilibj.xrp.XRPMotor
- All Implemented Interfaces:
MotorController
XRPMotor.
A SimDevice based motor controller representing the motors on an XRP robot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Disable the motor controller.doubleget()Common interface for getting the current set speed of a motor controller.booleanCommon interface for returning if a motor controller is in the inverted state or not.voidset(double speed) Common interface for setting the speed of a motor controller.voidsetInverted(boolean isInverted) Common interface for inverting direction of a motor controller.voidStops motor movement.Methods 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
-
XRPMotor
Constructs an XRPMotor.- Parameters:
deviceNum- the motor channel
-
-
Method Details
-
set
Description copied from interface:MotorControllerCommon interface for setting the speed of a motor controller.- Specified by:
setin interfaceMotorController- Parameters:
speed- The speed to set. Value should be between -1.0 and 1.0.
-
get
Description copied from interface:MotorControllerCommon interface for getting the current set speed of a motor controller.- Specified by:
getin interfaceMotorController- Returns:
- The current set speed. Value is 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.
-
disable
Description copied from interface:MotorControllerDisable the motor controller.- Specified by:
disablein interfaceMotorController
-
stopMotor
Description copied from interface:MotorControllerStops motor movement. Motor can be moved again by calling set without having to re-enable the motor.- Specified by:
stopMotorin interfaceMotorController
-