Package com.revrobotics
Interface CANAnalog
- All Superinterfaces:
CANSensor,MotorFeedbackSensor
- All Known Implementing Classes:
SparkMaxAnalogSensor
Deprecated, for removal: This API element is subject to removal in a future version.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDeprecated, for removal: This API element is subject to removal in a future version.UseSparkMaxAnalogSensor.Modeinstead -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated, for removal: This API element is subject to removal in a future version.Get the phase of the MotorFeedbackSensor.doubleDeprecated, for removal: This API element is subject to removal in a future version.Get the position of the sensor.doubleDeprecated, for removal: This API element is subject to removal in a future version.Get the current conversion factor for the position of the analog sensor.doubleDeprecated, for removal: This API element is subject to removal in a future version.Get the velocity of the sensor.doubleDeprecated, for removal: This API element is subject to removal in a future version.Get the current conversion factor for the velocity of the analog sensor.doubleDeprecated, for removal: This API element is subject to removal in a future version.Get the voltage of the analog sensor.setInverted(boolean inverted) Deprecated, for removal: This API element is subject to removal in a future version.Set the phase of the MotorFeedbackSensor so that it is set to be in phase with the motor itself.setPositionConversionFactor(double factor) Deprecated, for removal: This API element is subject to removal in a future version.Set the conversion factor for the position of the analog sensor.setVelocityConversionFactor(double factor) Deprecated, for removal: This API element is subject to removal in a future version.Set the conversion factor for the velocity of the analog sensor.
-
Method Details
-
getVoltage
double getVoltage()Deprecated, for removal: This API element is subject to removal in a future version.Get the voltage of the analog sensor.- Returns:
- Voltage of the sensor.
-
getPosition
double getPosition()Deprecated, for removal: This API element is subject to removal in a future version.Get the position of the sensor. Returns value in the native unit of 'volt' by default, and can be changed by a scale factor using setPositionConversionFactor().- Returns:
- Position of the sensor in volts
-
getVelocity
double getVelocity()Deprecated, for removal: This API element is subject to removal in a future version.Get the velocity of the sensor. Returns value in the native units of 'volts per second' by default, and can be changed by a scale factor using setVelocityConversionFactor().- Returns:
- Velocity of the sensor in volts per second
-
setPositionConversionFactor
Deprecated, for removal: This API element is subject to removal in a future version.Set the conversion factor for the position of the analog sensor. By default, revolutions per volt is 1. Changing the position conversion factor will also change the position units.- Parameters:
factor- The conversion factor which will be multiplied by volts- Returns:
REVLibError.kOkif successful
-
setVelocityConversionFactor
Deprecated, for removal: This API element is subject to removal in a future version.Set the conversion factor for the velocity of the analog sensor. By default, revolutions per volt second is 1. Changing the velocity conversion factor will also change the velocity units.- Parameters:
factor- The conversion factor which will be multiplied by volts per second- Returns:
REVLibError.kOkif successful
-
getPositionConversionFactor
double getPositionConversionFactor()Deprecated, for removal: This API element is subject to removal in a future version.Get the current conversion factor for the position of the analog sensor.- Returns:
- Analog position conversion factor
-
getVelocityConversionFactor
double getVelocityConversionFactor()Deprecated, for removal: This API element is subject to removal in a future version.Get the current conversion factor for the velocity of the analog sensor.- Returns:
- Analog velocity conversion factor
-
setInverted
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MotorFeedbackSensorSet the phase of the MotorFeedbackSensor so that it is set to be in phase with the motor itself. This only works for quadrature encoders and analog sensors. This will throw an error if the user tries to set the inversion of the hall sensor.- Specified by:
setInvertedin interfaceCANSensor- Specified by:
setInvertedin interfaceMotorFeedbackSensor- Parameters:
inverted- The phase of the sensor- Returns:
REVLibError.kOkif successful
-
getInverted
boolean getInverted()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MotorFeedbackSensorGet the phase of the MotorFeedbackSensor. This will just return false if the user tries to get the inversion of the hall sensor.- Specified by:
getInvertedin interfaceCANSensor- Specified by:
getInvertedin interfaceMotorFeedbackSensor- Returns:
- The phase of the sensor
-
AnalogInputinstead (orSparkMaxAnalogSensorif the analog sensor is connected directly to a SPARK MAX)