Class WsSparkMaxConfig
- java.lang.Object
-
- org.wildstang.hardware.roborio.outputs.config.WsSparkMaxConfig
-
- All Implemented Interfaces:
OutputConfig
public class WsSparkMaxConfig extends java.lang.Object implements OutputConfig
Contains configurations for Spark Max motor controllers.
-
-
Constructor Summary
Constructors Constructor Description WsSparkMaxConfig(int channel, boolean brushless)
Construct the Phoenix config.WsSparkMaxConfig(int channel, boolean brushless, boolean invert)
Construct the Phoenix config.WsSparkMaxConfig(int channel, boolean brushless, boolean invert, double p_default)
Construct the Phoenix config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getChannel()
Returns the hardware port number.double
getDefault()
Returns the default output value.boolean
isBrushless()
Returns true if the motor is brushless.boolean
isInverted()
Returns if the controller should be inverted.java.lang.String
toString()
Builds a JSON String describing the Spark Max config.
-
-
-
Constructor Detail
-
WsSparkMaxConfig
public WsSparkMaxConfig(int channel, boolean brushless)
Construct the Phoenix config.- Parameters:
channel
- Controller CAN constant.brushless
- True if the motor is brushless, false if brushed.
-
WsSparkMaxConfig
public WsSparkMaxConfig(int channel, boolean brushless, boolean invert)
Construct the Phoenix config.- Parameters:
channel
- Controller CAN constant.brushless
- True if the motor is brushless, false if brushed.invert
- True if motor output should be inverted.
-
WsSparkMaxConfig
public WsSparkMaxConfig(int channel, boolean brushless, boolean invert, double p_default)
Construct the Phoenix config.- Parameters:
channel
- Controller CAN constant.brushless
- True if the motor is brushless, false if brushed.invert
- True if motor output should be inverted.p_default
- Default output value.
-
-
Method Detail
-
getChannel
public int getChannel()
Returns the hardware port number.- Returns:
- The hardware port number.
-
getDefault
public double getDefault()
Returns the default output value.- Returns:
- The default value.
-
isBrushless
public boolean isBrushless()
Returns true if the motor is brushless.- Returns:
- True if the motor is brushless, false if brushed.
-
isInverted
public boolean isInverted()
Returns if the controller should be inverted.- Returns:
- True if inverted.
-
toString
public java.lang.String toString()
Builds a JSON String describing the Spark Max config.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Channel number and is talon.
-
-