Class SparkAnalogSensor

java.lang.Object
com.revrobotics.spark.SparkAnalogSensor
All Implemented Interfaces:
AnalogInput

public class SparkAnalogSensor extends Object implements AnalogInput
Get an instance of this class by using SparkBase.getAnalog().
  • Method Details

    • getVoltage

      public Signal<Double> getVoltage()
      Get the voltage of the analog sensor.
      Specified by:
      getVoltage in interface AnalogInput
      Returns:
      Voltage of the sensor.
    • getPosition

      public Signal<Double> getPosition()
      Get the position of the sensor. Returns value in the native unit of 'volt'.
      Specified by:
      getPosition in interface AnalogInput
      Returns:
      Position of the sensor
    • getVelocity

      public Signal<Double> getVelocity()
      Get the velocity of the sensor. Returns value in the native units of 'volts per second'.
      Returns:
      Velocity of the sensor in volts per second