Package com.revrobotics
Interface CANAnalog
-
- All Superinterfaces:
CANSensor
,MotorFeedbackSensor
- All Known Implementing Classes:
SparkMaxAnalogSensor
@Deprecated(forRemoval=true) public interface CANAnalog extends MotorFeedbackSensor
Deprecated, for removal: This API element is subject to removal in a future version.useAnalogInput
instead (orSparkMaxAnalogSensor
if the analog sensor is connected directly to a SPARK MAX)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
CANAnalog.AnalogMode
Deprecated, for removal: This API element is subject to removal in a future version.UseSparkMaxAnalogSensor.Mode
instead
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
getInverted()
Deprecated, for removal: This API element is subject to removal in a future version.Get the phase of the MotorFeedbackSensor.double
getPosition()
Deprecated, for removal: This API element is subject to removal in a future version.Get the position of the sensor.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.double
getVelocity()
Deprecated, for removal: This API element is subject to removal in a future version.Get the velocity of the sensor.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.double
getVoltage()
Deprecated, for removal: This API element is subject to removal in a future version.Get the voltage of the analog sensor.REVLibError
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.REVLibError
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.REVLibError
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 Detail
-
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
REVLibError 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. 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.kOk
if successful
-
setVelocityConversionFactor
REVLibError 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. 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.kOk
if 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
REVLibError setInverted(boolean inverted)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MotorFeedbackSensor
Set 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:
setInverted
in interfaceCANSensor
- Specified by:
setInverted
in interfaceMotorFeedbackSensor
- Parameters:
inverted
- The phase of the sensor- Returns:
REVLibError.kOk
if successful
-
getInverted
boolean getInverted()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MotorFeedbackSensor
Get the phase of the MotorFeedbackSensor. This will just return false if the user tries to get the inversion of the hall sensor.- Specified by:
getInverted
in interfaceCANSensor
- Specified by:
getInverted
in interfaceMotorFeedbackSensor
- Returns:
- The phase of the sensor
-
-