Reference   Language | Libraries | Comparison | Changes

CurieIMU

autoCalibrateAccelerometerOffset()

Description

Starts an auto-calibration of the accelerometer's offset for the axis specified as argument. This procedure should be executed while the board is kept laying flat and motionless. The offset is stored in the IMU registers and can be read with getAccelerometerOffset.

Syntax

CurieIMU.autoCalibrateAccelerometerOffset(int, axis, int target)

Parameters

axis: the axis to calibrate. It can assume one of these values:

  • X_AXIS
  • Y_AXIS
  • Z_AXIS


target: it can be 0 or 1. In particular it has to be used in this way:

  • CurieIMU.autoCalibrateAccelerometerOffset(X_AXIS, 0);
  • CurieIMU.autoCalibrateAccelerometerOffset(Y_AXIS, 0);
  • CurieIMU.autoCalibrateAccelerometerOffset(Z_AXIS, 1);


The target for Z is 1 because it represents the vertical force of gravity (1g) that should be read when the board is laying flat.

See also

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.