Read calibration status of BNO055 sensor
Read Calibrated Status of Sensor
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.
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
bno055 — BNO055 sensor object
BNO055 sensor object created in
ndof operating mode
with the default or specified properties.
status — Calibration status
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 Sensor||Sensor Status|
|0||Sensor is uncalibrated|
|1||Sensor is partially calibrated|
|2||Sensor is partially calibrated|
|3||Sensor is fully calibrated|
timestamp — Timestamp
The time at which MATLAB® receives the calibration status, specified as a datetime.
Code Generation Using MATLAB Function Block
readCalibrationStatusin a MATLAB Function block with the Simulink® Support Package for Arduino® Hardware to generate code that can be deployed on Arduino Hardware.
Timestampreturned is always in seconds.
readCalibrationStatusreturns integers that correspond the to the calibration status of the sensor.
Value Calibration Status 0 uncalibrated 1 or 2 partially calibrated 3 fully calibrated
Introduced in R2019b