Main Content

readCalibrationStatus

Read calibration status of sensor

Description

example

[status,timestamp] = readCalibrationStatus(bno055) returns the calibration status of the BNO055 sensor in NDOF operating mode. See Calibrate BNO055 Sensors for the steps to calibrate the sensor.

Examples

Read Calibrated Status of Sensor

Create an arduino object

a = arduino('COM4', 'Uno', 'Libraries', 'I2C');

Create the BNO055 sensor object.

imu = bno055(a,'OperatingMode','ndof');

Calibrate the sensor using steps mentioned in Calibrate BNO055 Sensors.

pause(50)

Read calibration status of sensor.

[status,timestamp] = readCalibrationStatus(imu)
status = 
       struct with fields:

           System: "uncalibrated"
    Accelerometer: "uncalibrated"
        Gyroscope: "full"
     Magnetometer: "uncalibrated"

timestamp = datetime 
   21-Jul-2020 08:09:45.785

Input Arguments

collapse all

BNO055 sensor object created in ndof operating mode with the default or specified properties.

Output Arguments

collapse all

Calibration status of the system, gyroscope, accelerometer, and magnetometer in the BNO055 sensor specified as a structure array. The values as seen by sensor correspond to the calibration status of the sensors. The values are in the range 0-3 .The table describes each of the values

Value as seen by the SensorstatusSensor Status
0"uncalibrated"Sensor is uncalibrated
1"partial"Sensor is partially calibrated
2"partial"Sensor is partially calibrated
3"full"Sensor is fully calibrated

Data Types: struct

The time at which MATLAB® receives the calibration status, specified as a datetime.

Data Types: datetime

More About

collapse all

Code Generation Using MATLAB Function Block

  • Use readCalibrationStatus in a MATLAB Function block with the Simulink® Support Package for Arduino® Hardware to generate code that can be deployed on Arduino Hardware.

  • Timestamp returned is always in seconds.

  • The readCalibrationStatus returns intergers that correspond the to the calibration status of the sensor.

    ValueCalibration Status
    0uncalibrated
    1 or 2partially calibrated
    3fully calibrated

Introduced in R2019b