Package com.revrobotics.spark.config
Class AnalogSensorConfig
java.lang.Object
com.revrobotics.spark.config.BaseConfig
com.revrobotics.spark.config.AnalogSensorConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(AnalogSensorConfig config) Applies settings from anotherAnalogSensorConfig
to this one.inverted
(boolean inverted) Set the phase of the analog sensor so that it is in phase with the motor itself.positionConversionFactor
(double factor) Set the conversion factor for the position of the analog sensor.velocityConversionFactor
(double factor) Set the conversion factor for the velocity of the analog sensor.Methods inherited from class com.revrobotics.spark.config.BaseConfig
flatten
-
Constructor Details
-
AnalogSensorConfig
public AnalogSensorConfig()
-
-
Method Details
-
apply
Applies settings from anotherAnalogSensorConfig
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
- TheAnalogSensorConfig
to copy settings from- Returns:
- The updated
AnalogSensorConfig
for method chaining
-
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
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
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
-