Package com.revrobotics.spark
Class SparkAnalogSensor
java.lang.Object
com.revrobotics.spark.SparkAnalogSensor
- All Implemented Interfaces:
AnalogInput
Get an instance of this class by using
SparkBase.getAnalog()
.-
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the position of the sensor.double
Get the velocity of the sensor.double
Get the voltage of the analog sensor.
-
Method Details
-
getVoltage
public double getVoltage()Get the voltage of the analog sensor.- Specified by:
getVoltage
in interfaceAnalogInput
- Returns:
- Voltage of the sensor.
-
getPosition
public double getPosition()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().- Specified by:
getPosition
in interfaceAnalogInput
- Returns:
- Position of the sensor
-
getVelocity
public double getVelocity()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
-