Arduino_BMI270_BMM150 - readGyroscope()

Query the IMU’s gyroscope and return the angular speed in dps (degrees per second).

Syntax

IMU.readGyroscope(x,y,z)

Parameters

  • x: float variable where the gyroscope value in the IMU’s x-axis will be stored.
  • y: float variable where the gyroscope value in the IMU’s y-axis will be stored.
  • z: float variable where the gyroscope value in the IMU’s z-axis will be stored.

Returns

1 on success, 0 on failure.

Example

float x, y, z;

if (IMU.gyroscopeAvailable()) {
    IMU.readGyroscope(x, y, z);

    Serial.print(x);
    Serial.print('\t');
    Serial.print(y);
    Serial.print('\t');
    Serial.println(z);
}

See also