Package ftclib.sensor

Class FtcAnalogInput


public class FtcAnalogInput extends TrcAnalogInput
This class implements a platform dependent AnalogInput sensor extending TrcAnalogInput. It provides implementation of the abstract methods in TrcAnalogInput.
  • Field Details

    • sensor

      private final com.qualcomm.robotcore.hardware.AnalogInput sensor
  • Constructor Details

    • FtcAnalogInput

      public FtcAnalogInput(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, TrcFilter[] filters)
      Constructor: Creates an instance of the object.
      Parameters:
      hardwareMap - specifies the global hardware map.
      instanceName - specifies the instance name.
      filters - specifies an array of filter objects, one for each axis, to filter sensor data. If no filter is used, this can be set to null.
    • FtcAnalogInput

      public FtcAnalogInput(String instanceName, TrcFilter[] filters)
      Constructor: Creates an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      filters - specifies an array of filter objects, one for each axis, to filter sensor data. If no filter is used, this can be set to null.
    • FtcAnalogInput

      public FtcAnalogInput(String instanceName)
      Constructor: Creates an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
  • Method Details

    • calibrate

      public void calibrate()
      This method calibrates the sensor.
    • getRawData

      public TrcSensor.SensorData<Double> getRawData(int index, TrcAnalogInput.DataType dataType)
      This method returns the raw sensor data of the specified type.
      Specified by:
      getRawData in class TrcAnalogInput
      Parameters:
      index - specifies the data index (not used).
      dataType - specifies the data type.
      Returns:
      raw sensor data of the specified type.