Enum MotorIdleMode
- java.lang.Object
-
- java.lang.Enum<MotorIdleMode>
-
- com.alumiboti5590.eop.components.motors.util.MotorIdleMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MotorIdleMode>
public enum MotorIdleMode extends java.lang.Enum<MotorIdleMode>
A single interface for controlling motor idles that allows for spanning RevRobotics or CTRE libraries.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.revrobotics.CANSparkMax.IdleMode
toIdleMode()
Returns the corresponding value of RevRobotics' IdleModecom.ctre.phoenix.motorcontrol.NeutralMode
toNeutralMode()
Returns the corresponding value of CTRE's NeutralModestatic MotorIdleMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static MotorIdleMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
kCoast
public static final MotorIdleMode kCoast
The motor will not 'fight' any external forces against it when the speed is set to zero
-
kBrake
public static final MotorIdleMode kBrake
The motor will attempt to 'soft brake' itself when the speed is set to zero
-
-
Method Detail
-
values
public static MotorIdleMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MotorIdleMode c : MotorIdleMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MotorIdleMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toIdleMode
public com.revrobotics.CANSparkMax.IdleMode toIdleMode()
Returns the corresponding value of RevRobotics' IdleMode- Returns:
- the corresponding IdleMode
-
toNeutralMode
public com.ctre.phoenix.motorcontrol.NeutralMode toNeutralMode()
Returns the corresponding value of CTRE's NeutralMode- Returns:
- the corresponding NeutralMode
-
-