/** * Provides a rotation compensated roll of the device, based on the latest update retrieved from the accelerometer. * * @return The roll of the device, in radians. * * @code * accelerometer.getRollRadians(); * @endcode */ float MicroBitAccelerometer::getRollRadians() { if (!(status & MICROBIT_ACCEL_PITCH_ROLL_VALID)) recalculatePitchRoll(); return roll; }
/** * Provides a rotation compensated roll of the device, based on the latest update retrieved from the accelerometer. * * @return The roll of the device, in radians. * * @code * accelerometer.getRollRadians(); * @endcode */ float MicroBitAccelerometer::getRollRadians() { requestUpdate(); if (!(status & MICROBIT_ACCELEROMETER_IMU_DATA_VALID)) recalculatePitchRoll(); return roll; }