Class WsSparkConfig

java.lang.Object
org.wildstang.hardware.roborio.outputs.config.WsSparkConfig
All Implemented Interfaces:
OutputConfig

public class WsSparkConfig extends Object implements OutputConfig
Contains configurations for Spark Max/Flex motor controllers.
  • Constructor Details

    • WsSparkConfig

      public WsSparkConfig(int channel, WsMotorControllers controller)
      Construct the Phoenix config.
      Parameters:
      channel - Controller CAN constant.
      controller - Enumeration representing type of controller.
    • WsSparkConfig

      public WsSparkConfig(int channel, WsMotorControllers controller, boolean invert)
      Construct the Phoenix config.
      Parameters:
      channel - Controller CAN constant.
      controller - Enumeration representing type of controller.
      invert - True if motor output should be inverted.
    • WsSparkConfig

      public WsSparkConfig(int channel, WsMotorControllers controller, boolean invert, double p_default)
      Construct the Phoenix config.
      Parameters:
      channel - Controller CAN constant.
      controller - Enumeration representing type of controller.
      invert - True if motor output should be inverted.
      p_default - Default output value.
  • Method Details

    • getChannel

      public int getChannel()
      Returns the hardware port number.
      Returns:
      The hardware port number.
    • getType

      public WsMotorControllers getType()
      Returns the motor controller type.
      Returns:
      The hardware motor controller type.
    • getDefault

      public double getDefault()
      Returns the default output value.
      Returns:
      The default value.
    • isInverted

      public boolean isInverted()
      Returns if the controller should be inverted.
      Returns:
      True if inverted.
    • toString

      public String toString()
      Builds a JSON String describing the Spark Max config.
      Overrides:
      toString in class Object
      Returns:
      Channel number and is talon.