com.qualcomm.robotcore.hardware

## Interface CompassSensor

- All Superinterfaces:
    HardwareDevice

      public interface CompassSensor
      extends HardwareDevice

  Compass Sensor

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `CompassSensor.CompassMode`

    - ### 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
    --- | ---
    `boolean` | `calibrationFailed()` Check to see whether calibration was successful.
    `double` | `getDirection()` Get the current direction, in degrees, in the range [0, 360).
    `void` | `setMode(CompassSensor.CompassMode mode)` Change to calibration or measurement mode
    `java.lang.String` | `status()` Status of this sensor, in string form

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

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

- - ### Method Detail

    - #### getDirection

          double getDirection()

      Get the current direction, in degrees, in the range [0, 360). North is zero, East is 90, South is 180, and West is 270.
      Returns:
        current direction, in degrees

    - #### status

          java.lang.String status()

      Status of this sensor, in string form
      Returns:
        status

    - #### setMode

          void setMode(CompassSensor.CompassMode mode)

      Change to calibration or measurement mode

    - #### calibrationFailed

          boolean calibrationFailed()

      Check to see whether calibration was successful. After attempting a calibration, the hardware will (eventually) indicate whether or not it was unsuccessful. The default is "success", even when the calibration is not guaranteed to have completed successfully. A user should monitor this field for (at least) several seconds to determine success.
      Returns:
        failure