Class AnalogSensorConfig

java.lang.Object
com.revrobotics.spark.config.BaseConfig
com.revrobotics.spark.config.AnalogSensorConfig

public class AnalogSensorConfig extends BaseConfig
  • Constructor Details

    • AnalogSensorConfig

      public AnalogSensorConfig()
  • Method Details

    • apply

      public AnalogSensorConfig apply(AnalogSensorConfig config)
      Applies settings from another AnalogSensorConfig to this one.

      Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

      Parameters:
      config - The AnalogSensorConfig to copy settings from
      Returns:
      The updated AnalogSensorConfig for method chaining
    • inverted

      public AnalogSensorConfig inverted(boolean inverted)
      Set the phase of the analog sensor so that it is in phase with the motor itself.
      Parameters:
      inverted - The phase of the analog sensor
      Returns:
      The modified AnalogSensorConfig object for method chaining
    • positionConversionFactor

      public AnalogSensorConfig positionConversionFactor(double factor)
      Set the conversion factor for the position of the analog sensor. Position is returned in native units of volts and will be multiplied by this conversion factor.
      Parameters:
      factor - The conversion factor to multiply the native units by
      Returns:
      The modified AnalogSensorConfig object for method chaining
    • velocityConversionFactor

      public AnalogSensorConfig velocityConversionFactor(double factor)
      Set the conversion factor for the velocity of the analog sensor. Velocity is returned in native units of volts per second and will be multiplied by this conversion factor.
      Parameters:
      factor - The conversion factor to multiply the native units by
      Returns:
      The modified AnalogSensorConfig object for method chaining