readCalibrationStatus

Read calibration status of sensor

Description

example

[status,timestamp] = readCalibrationStatus(BNO055Sensor) returns the calibration status of the accelerometer, gyroscope, and magnetometer sensors in the BNO055 sensor, and the overall system .

Examples

collapse all

Create an arduino object.

arduinoObj = arduino("COM5","MKR1000","Libraries","Adafruit/BNO055")
arduinoObj = 
  arduino with properties:

                  Port: 'COM5'
                 Board: 'MKR1000'
         AvailablePins: {'D0-D14', 'A0-A6'}
  AvailableDigitalPins: {'D0-D14', 'A0-A6'}
      AvailablePWMPins: {'D0-D8', 'D10', 'A3-A4'}
   AvailableAnalogPins: {'A0-A6'}
    AvailableI2CBusIDs: [0]
AvailableSerialPortIDs: [1]
             Libraries: {'Adafruit/BNO055', 'I2C'}

Create a BNO055Sensor object.

BNO055Sensor = addon(arduinoObj,'Adafruit/BNO055')
BNO055Sensor = 
  BNO055 with properties:

               SCLPin: 'D12'
               SDAPin: 'D11'
                  Bus: 0
           I2CAddress: 40 ('0x28')

To calibrate the sensors, follow the steps in Calibrate BNO055 Sensors.

pause(50)

Read the calibration status of the sensor.

[status,timestamp] = readCalibrationStatus(BNO055Sensor)
status = struct with fields:
           System: "uncalibrated"
    Accelerometer: "uncalibrated"
        Gyroscope: "full"
     Magnetometer: "uncalibrated"

timestamp = datetime
   24-Jul-2019 08:09:45.785

Input Arguments

collapse all

BNO055 sensor connection, specified as an addon object.

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

A partially calibrated sensor with calibration status 2 returns more accurate readings compared to the one with calibration status 1

Data Types: struct

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

Data Types: datetime

Introduced in R2019b