org.firstinspires.ftc.robotcore.external.android

## Class AndroidAccelerometer

- java.lang.Object
- - org.firstinspires.ftc.robotcore.external.android.AndroidAccelerometer

-     public class AndroidAccelerometer
      extends java.lang.Object

  A class that provides access to the Android Accelerometer.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AndroidAccelerometer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Acceleration` | `getAcceleration()` Returns an Acceleration object representing acceleration in X, Y and Z axes.
    `DistanceUnit` | `getDistanceUnit()` Returns the DistanceUnit being used.
    `double` | `getX()` Returns the acceleration in the x-axis.
    `double` | `getY()` Returns the acceleration in the y-axis.
    `double` | `getZ()` Returns the acceleration in the z-axis.
    `boolean` | `isAvailable()` Returns true if the Android device has a accelerometer.
    `void` | `onAccuracyChanged(Sensor sensor, int accuracy)`
    `void` | `onSensorChanged(SensorEvent sensorEvent)`
    `void` | `setDistanceUnit(DistanceUnit distanceUnit)` Sets the DistanceUnit to be used.
    `void` | `startListening()` Start listening to events from the Android accelerometer.
    `void` | `stopListening()` Stop listening to events from the Android accelerometer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AndroidAccelerometer

          public AndroidAccelerometer()

  - ### Method Detail

    - #### onAccuracyChanged

          public void onAccuracyChanged(Sensor sensor,
                                        int accuracy)

    - #### onSensorChanged

          public void onSensorChanged(SensorEvent sensorEvent)

    - #### setDistanceUnit

          public void setDistanceUnit(DistanceUnit distanceUnit)

      Sets the DistanceUnit to be used.

    - #### getDistanceUnit

          public DistanceUnit getDistanceUnit()

      Returns the DistanceUnit being used.

    - #### getX

          public double getX()

      Returns the acceleration in the x-axis.

    - #### getY

          public double getY()

      Returns the acceleration in the y-axis.

    - #### getZ

          public double getZ()

      Returns the acceleration in the z-axis.

    - #### getAcceleration

          public Acceleration getAcceleration()

      Returns an Acceleration object representing acceleration in X, Y and Z axes.

    - #### isAvailable

          public boolean isAvailable()

      Returns true if the Android device has a accelerometer.

    - #### startListening

          public void startListening()

      Start listening to events from the Android accelerometer.

    - #### stopListening

          public void stopListening()

      Stop listening to events from the Android accelerometer.