com.qualcomm.robotcore.hardware

## Interface IrSeekerSensor

- All Superinterfaces:
    HardwareDevice

      public interface IrSeekerSensor
      extends HardwareDevice

  IR Seeker Sensor

  Determine the location of an IR source

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `IrSeekerSensor.IrSeekerIndividualSensor` IR Sensor attached to an IR Seeker
    `static class` | `IrSeekerSensor.Mode` Enumeration of device modes

    - ### Nested classes/interfaces inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `HardwareDevice.Manufacturer`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getAngle()` Estimated angle in which the signal is coming from
    `I2cAddr` | `getI2cAddress()` Get the current I2C Address of this object.
    `IrSeekerSensor.IrSeekerIndividualSensor[]` | `getIndividualSensors()` Get a list of all IR sensors attached to this seeker.
    `IrSeekerSensor.Mode` | `getMode()` Get the device mode
    `double` | `getSignalDetectedThreshold()` Get the minimum threshold for a signal to be considered detected
    `double` | `getStrength()` IR Signal strength
    `void` | `setI2cAddress(I2cAddr newAddress)` Set the I2C address to a new value.
    `void` | `setMode(IrSeekerSensor.Mode mode)` Set the device mode
    `void` | `setSignalDetectedThreshold(double threshold)` Set the minimum threshold for a signal to be considered detected
    `boolean` | `signalDetected()` Returns true if an IR signal is detected

    - ### Methods inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `close, getConnectionInfo, getDeviceName, getManufacturer, getVersion, resetDeviceConfigurationForOpMode`

- - ### Method Detail

    - #### setSignalDetectedThreshold

          void setSignalDetectedThreshold(double threshold)

      Set the minimum threshold for a signal to be considered detected
      Parameters:
        `threshold` - minimum threshold

    - #### getSignalDetectedThreshold

          double getSignalDetectedThreshold()

      Get the minimum threshold for a signal to be considered detected
      Returns:
        threshold

    - #### setMode

          void setMode(IrSeekerSensor.Mode mode)

      Set the device mode
      Parameters:
        `mode` - sample rate

    - #### getMode

          IrSeekerSensor.Mode getMode()

      Get the device mode
      Returns:
        device mode

    - #### signalDetected

          boolean signalDetected()

      Returns true if an IR signal is detected
      Returns:
        true if signal is detected; otherwise false

    - #### getAngle

          double getAngle()

      Estimated angle in which the signal is coming from

      If the signal is estimated to be directly ahead, 0 will be returned. If the signal is to the left a negative angle will be returned. If the signal is to the right a positive angle will be returned. If no signal is detected, a 0 will be returned.

      NOTE: not all sensors give an accurate angle.

      Returns:
        angle to IR signal

    - #### getStrength

          double getStrength()

      IR Signal strength

      Detected IR signal strength, on a scale of 0.0 to 1.0, where 0 is no signal detected and 1 is max IR signal detected.

      Returns:
        signal strength, scaled from 0 to 1

    - #### getIndividualSensors

          IrSeekerSensor.IrSeekerIndividualSensor[] getIndividualSensors()

      Get a list of all IR sensors attached to this seeker. The list will include the angle at which the sensor is mounted, and the signal strength.
      Returns:
        array of IrSensors

    - #### setI2cAddress

          void setI2cAddress(I2cAddr newAddress)

      Set the I2C address to a new value.

    - #### getI2cAddress

          I2cAddr getI2cAddress()

      Get the current I2C Address of this object. Not necessarily the same as the I2C address of the actual device. Return the current I2C address.
      Returns:
        current I2C address