Arduino_LSM6DSOX - accelerationAvailable()

Query if new acceleration data from the IMU is available.

Syntax

IMU.accelerationAvailable()

Parameters

None.

Returns

0 if no new acceleration data is available, 1 if new acceleration data is available.

Example

float x, y, z;

if (IMU.accelerationAvailable()) {
    IMU.readAcceleration(x, y, z);

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

See also