Extended and refactored library for BNO055, an intelligent 9-axis absolute orientation sensor by Bosch Sensortec. It includes ACC, MAG and GYRO sensors and Cortex-M0 processor.

Fork of BNO055_fusion by Kenji Arai

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BNO055.h Source File

BNO055.h

00001 /*
00002  * mbed library program
00003  *  BNO055 Intelligent 9-axis absolute orientation sensor
00004  *  by Bosch Sensortec
00005  *
00006  * Copyright (c) 2015,'17 Kenji Arai / JH1PJL
00007  *  http://www.page.sannet.ne.jp/kenjia/index.html
00008  *  http://mbed.org/users/kenjiArai/
00009  *      Created: March     30th, 2015
00010  *      Revised: August    23rd, 2017
00011  */
00012 /*
00013  *---------------- REFERENCE ----------------------------------------------------------------------
00014  * Original Information
00015  *  https://www.bosch-sensortec.com/en/homepage/products_3/sensor_hubs/iot_solutions/bno055_1/bno055_4
00016  *  Intelligent 9-axis absolute orientation sensor / Data Sheet  BST_BNO055_DS000_12 Nov. 2014 rev.1.2
00017  *  Sample software   https://github.com/BoschSensortec/BNO055_driver
00018  * Sensor board
00019  *  https://www.rutronik24.com/product/bosch+se/bno055+shuttle+board+mems/6431291.html
00020  *  http://microcontrollershop.com/product_info.php?products_id=7140&osCsid=10645k86db2crld4tfi0vol5g5
00021  */
00022 
00023 #ifndef BNO055_H
00024 #define BNO055_H
00025 
00026 #include "mbed.h"
00027 
00028 //  BNO055
00029 //  7bit address = 0b010100x(0x28 or 0x29 depends on COM3)
00030 #define BNO055_G_CHIP_ADDR      (0x28 << 1) // COM3 = GND
00031 #define BNO055_V_CHIP_ADDR      (0x29 << 1) // COM3 = Vdd
00032 
00033 // Fusion mode
00034 #define CONFIGMODE              0x00
00035 #define MODE_IMU                0x08
00036 #define MODE_COMPASS            0x09
00037 #define MODE_M4G                0x0a
00038 #define MODE_NDOF_FMC_OFF       0x0b
00039 #define MODE_NDOF               0x0c
00040 
00041 //  UNIT
00042 #define UNIT_ACC_MSS            0x00    // acc m/s2
00043 #define UNIT_ACC_MG             0x01    // acc mg
00044 #define UNIT_GYR_DPS            0x00    // gyro Dps
00045 #define UNIT_GYR_RPS            0x02    // gyro Rps
00046 #define UNIT_EULER_DEG          0x00    // euler Degrees
00047 #define UNIT_EULER_RAD          0x04    // euler Radians
00048 #define UNIT_TEMP_C             0x00    // temperature degC
00049 #define UNIT_TEMP_F             0x10    // temperature degF
00050 #define UNIT_ORI_WIN            0x00    // Windows orientation
00051 #define UNIT_ORI_ANDROID        0x80    // Android orientation
00052 
00053 //  ID's
00054 #define I_AM_BNO055_CHIP        0xa0    // CHIP ID
00055 #define I_AM_BNO055_ACC         0xfb    // ACC ID
00056 #define I_AM_BNO055_MAG         0x32    // MAG ID
00057 #define I_AM_BNO055_GYR         0x0f    // GYR ID
00058 
00059 ////////////// DATA TYPE DEFINITION ///////////////////////
00060 typedef struct {
00061     uint8_t  chip_id;
00062     uint8_t  acc_id;
00063     uint8_t  mag_id;
00064     uint8_t  gyr_id;
00065     uint8_t  bootldr_rev_id;
00066     uint16_t sw_rev_id;
00067 } BNO055_ID_INF_TypeDef;
00068 
00069 typedef struct {
00070     double h;
00071     double r;
00072     double p;
00073 } BNO055_EULER_TypeDef;
00074 
00075 typedef struct {
00076     double x;
00077     double y;
00078     double z;
00079     double w;
00080 } BNO055_QUATERNION_TypeDef;
00081 
00082 typedef struct {
00083     double x;
00084     double y;
00085     double z;
00086 } BNO055_VECTOR_TypeDef;
00087 
00088 typedef struct {
00089     int8_t acc_chip;
00090     int8_t gyr_chip;
00091 } BNO055_TEMPERATURE_TypeDef;
00092 
00093 enum {MT_P0 = 0, MT_P1, MT_P2, MT_P3, MT_P4, MT_P5, MT_P6, MT_P7};
00094 
00095 /** Interface for Bosch Sensortec Intelligent 9-axis absolute orientation sensor
00096  *      Chip: BNO055
00097  *
00098  * @code
00099  * #include    "mbed.h"
00100  * #include    "BNO055.h"
00101  *
00102  * Serial pc(USBTX,USBRX);
00103  * I2C    i2c(PB_9, PB_8);         // SDA, SCL
00104  * BNO055 imu(i2c, PA_8);          // Reset
00105  *
00106  * BNO055_ID_INF_TypeDef bno055_id_inf;
00107  * BNO055_EULER_TypeDef  euler_angles;
00108  *
00109  * int main() {
00110  *     pc.printf("Bosch Sensortec BNO055 test program on " __DATE__ "/" __TIME__ "\r\n");
00111  *     if (imu.chip_ready() == 0){
00112  *         pc.printf("Bosch BNO055 is NOT avirable!!\r\n");
00113  *     }
00114  *     imu.read_id_inf(&bno055_id_inf);
00115  *     pc.printf("CHIP:0x%02x, ACC:0x%02x, MAG:0x%02x, GYR:0x%02x, , SW:0x%04x, , BL:0x%02x\r\n",
00116  *                bno055_id_inf.chip_id, bno055_id_inf.acc_id, bno055_id_inf.mag_id,
00117  *                bno055_id_inf.gyr_id, bno055_id_inf.sw_rev_id, bno055_id_inf.bootldr_rev_id);
00118  *     while(1) {
00119  *         imu.get_Euler_Angles(&euler_angles);
00120  *         pc.printf("Heading:%+6.1f [deg], Roll:%+6.1f [deg], Pich:%+6.1f [deg]\r\n",
00121  *                    euler_angles.h, euler_angles.r, euler_angles.p);
00122  *         wait(0.5);
00123  *     }
00124  * }
00125  * @endcode
00126  */
00127 
00128 class BNO055
00129 {
00130 public:
00131     /** Configure data pin
00132       * @param data SDA and SCL pins
00133       * @param device address
00134       */
00135     BNO055(PinName p_sda, PinName p_scl, PinName p_reset, uint8_t addr, uint8_t mode);
00136 
00137     /** Configure data pin
00138       * @param data SDA and SCL pins
00139       * @param Other parameters are set default data
00140       */
00141     BNO055(PinName p_sda, PinName p_scl, PinName p_reset);
00142 
00143     /** Configure data pin (with other devices on I2C line)
00144       * @param I2C previous definition
00145       * @param device address
00146       */
00147     BNO055(I2C& p_i2c, PinName p_reset, uint8_t addr, uint8_t mode);
00148 
00149     /** Configure data pin (with other devices on I2C line)
00150       * @param I2C previous definition
00151       * @param Other parameters are set default data
00152       */
00153     BNO055(I2C& p_i2c, PinName p_reset);
00154 
00155     /** Get Euler Angles
00156      * @param double type of 3D data address
00157      */
00158     void get_euler_angles(BNO055_EULER_TypeDef *el);
00159 
00160     /** Get Quaternion XYZ&W
00161      * @param int16_t type of 4D data address
00162      */
00163     void get_quaternion(BNO055_QUATERNION_TypeDef *qua);
00164 
00165     /** Get Linear accel data
00166      * @param double type of 3D data address
00167      */
00168     void get_linear_accel(BNO055_VECTOR_TypeDef *la);
00169 
00170     /** Get Mag data
00171      * @param double type of 3D data address
00172      */
00173     void get_mag(BNO055_VECTOR_TypeDef *qua);
00174 
00175     /** Get Accel data
00176      * @param double type of 3D data address
00177      */
00178     void get_accel(BNO055_VECTOR_TypeDef *la);
00179 
00180     /** Get Gyro data
00181      * @param double type of 3D data address
00182      */
00183     void get_gyro(BNO055_VECTOR_TypeDef *gr);
00184 
00185     /** Get Gravity data
00186      * @param double type of 3D data address
00187      */
00188     void get_gravity(BNO055_VECTOR_TypeDef *gr);
00189 
00190     /** Get Chip temperature data both Acc & Gyro
00191      * @param int8_t type of data address
00192      */
00193     void get_chip_temperature(BNO055_TEMPERATURE_TypeDef *tmp);
00194 
00195     /** Change fusion mode
00196       * @param fusion mode
00197       * @return none
00198       */
00199     void change_fusion_mode(uint8_t mode);
00200 
00201     /** Set Mouting position
00202       *  Please make sure your mounting direction of BNO055 chip
00203       *  refrence: BNO055 data sheet BST-BNO055-DS000-12 3.4 Axis remap
00204       * @param Set P0 to P7 mounting position data
00205       * @return none
00206       */
00207     void set_mounting_position(uint8_t position);
00208 
00209     /** Read BNO055 ID information
00210       * @param ID information address
00211       * @return none
00212       */
00213     void read_id_inf(BNO055_ID_INF_TypeDef *id);
00214 
00215     /** Check chip is avairable or not
00216       * @param none
00217       * @return OK = 1, NG = 0;
00218       */
00219     uint8_t chip_ready(void);
00220 
00221     /** Read calibration status
00222       * @param none
00223       * @return SYS(7:6),GYR(5:4),ACC(3:2),MAG(1:0) 3 = Calibrated, 0= not yet
00224       */
00225     uint8_t read_calib_status(void);
00226 
00227     /** Reset
00228       * @param none
00229       * @return 0 = sucess, 1 = Not available chip
00230       */
00231     uint8_t reset(void);
00232 
00233     /** Set I2C clock frequency
00234       * @param freq.
00235       * @return none
00236       */
00237     void frequency(int hz);
00238 
00239     /** Read page 0 register
00240       * @param register's address
00241       * @return register data
00242       */
00243     uint8_t read_reg0(uint8_t addr);
00244 
00245     /** Write page 0 register
00246       * @param register's address
00247       * @param data
00248       * @return register data
00249       */
00250     uint8_t write_reg0(uint8_t addr, uint8_t data);
00251 
00252     /** Read page 1 register
00253       * @param register's address
00254       * @return register data
00255       */
00256     uint8_t read_reg1(uint8_t addr);
00257 
00258     /** Write page 1 register
00259       * @param register's address
00260       * @param data
00261       * @return register data
00262       */
00263     uint8_t write_reg1(uint8_t addr, uint8_t data);
00264 
00265     /** Determine if degrees (instead of radians) are used.
00266       * @return true if degrees are used
00267       */
00268     bool use_degrees();
00269 
00270     /** Determine if m/s*s (instead of mg) is used.
00271       * @return true if m/s*s are used
00272       */
00273     bool use_mss();
00274 
00275     /** Determine if dps (instead of rps) are used.
00276       * @return true if dps are used
00277       */
00278     bool use_dps();
00279 
00280     /** Determine if celsius (instead of fahrenheit) is used.
00281       * @return true if celsius are used
00282       */
00283     bool use_celsius();
00284 
00285 protected:
00286     void initialize(void);
00287     void initialize_reset_pin(void);
00288     void get_id(void);
00289     void set_initial_dt_to_regs(void);
00290     void unit_selection(void);
00291     uint8_t get_operating_mode(void);
00292     uint8_t select_page(uint8_t page);
00293 
00294     I2C *_i2c_p;
00295     I2C &_i2c;
00296     DigitalOut _res;
00297 
00298 private:
00299     char     dt[10];      // working buffer
00300     uint8_t  chip_addr;
00301     uint8_t  chip_mode;
00302     uint8_t  ready_flag;
00303     uint8_t  page_flag;
00304 
00305     uint8_t  chip_id;
00306     uint8_t  acc_id;
00307     uint8_t  mag_id;
00308     uint8_t  gyr_id;
00309     uint8_t  bootldr_rev_id;
00310     uint16_t sw_rev_id;
00311 
00312     bool unit_flag_is_set(uint8_t flag);
00313 };
00314 
00315 //---------------------------------------------------------
00316 //----- Register's definition -----------------------------
00317 //---------------------------------------------------------
00318 // Page id register definition
00319 #define BNO055_PAGE_ID          0x07
00320 
00321 //----- page0 ---------------------------------------------
00322 #define BNO055_CHIP_ID          0x00
00323 #define BNO055_ACCEL_REV_ID     0x01
00324 #define BNO055_MAG_REV_ID       0x02
00325 #define BNO055_GYRO_REV_ID      0x03
00326 #define BNO055_SW_REV_ID_LSB    0x04
00327 #define BNO055_SW_REV_ID_MSB    0x05
00328 #define BNO055_BL_REV_ID        0x06
00329 
00330 // Accel data register*/
00331 #define BNO055_ACC_X_LSB        0x08
00332 #define BNO055_ACC_X_MSB        0x09
00333 #define BNO055_ACC_Y_LSB        0x0a
00334 #define BNO055_ACC_Y_MSB        0x0b
00335 #define BNO055_ACC_Z_LSB        0x0c
00336 #define BNO055_ACC_Z_MSB        0x0d
00337 
00338 // Mag data register
00339 #define BNO055_MAG_X_LSB        0x0e
00340 #define BNO055_MAG_X_MSB        0x0f
00341 #define BNO055_MAG_Y_LSB        0x10
00342 #define BNO055_MAG_Y_MSB        0x11
00343 #define BNO055_MAG_Z_LSB        0x12
00344 #define BNO055_MAG_Z_MSB        0x13
00345 
00346 // Gyro data registers
00347 #define BNO055_GYR_X_LSB        0x14
00348 #define BNO055_GYR_X_MSB        0x15
00349 #define BNO055_GYR_Y_LSB        0x16
00350 #define BNO055_GYR_Y_MSB        0x17
00351 #define BNO055_GYR_Z_LSB        0x18
00352 #define BNO055_GYR_Z_MSB        0x19
00353 
00354 // Euler data registers
00355 #define BNO055_EULER_H_LSB      0x1a
00356 #define BNO055_EULER_H_MSB      0x1b
00357 
00358 #define BNO055_EULER_R_LSB      0x1c
00359 #define BNO055_EULER_R_MSB      0x1d
00360 
00361 #define BNO055_EULER_P_LSB      0x1e
00362 #define BNO055_EULER_P_MSB      0x1f
00363 
00364 // Quaternion data registers
00365 #define BNO055_QUATERNION_W_LSB 0x20
00366 #define BNO055_QUATERNION_W_MSB 0x21
00367 #define BNO055_QUATERNION_X_LSB 0x22
00368 #define BNO055_QUATERNION_X_MSB 0x23
00369 #define BNO055_QUATERNION_Y_LSB 0x24
00370 #define BNO055_QUATERNION_Y_MSB 0x25
00371 #define BNO055_QUATERNION_Z_LSB 0x26
00372 #define BNO055_QUATERNION_Z_MSB 0x27
00373 
00374 // Linear acceleration data registers
00375 #define BNO055_LINEAR_ACC_X_LSB 0x28
00376 #define BNO055_LINEAR_ACC_X_MSB 0x29
00377 #define BNO055_LINEAR_ACC_Y_LSB 0x2a
00378 #define BNO055_LINEAR_ACC_Y_MSB 0x2b
00379 #define BNO055_LINEAR_ACC_Z_LSB 0x2c
00380 #define BNO055_LINEAR_ACC_Z_MSB 0x2d
00381 
00382 // Gravity data registers
00383 #define BNO055_GRAVITY_X_LSB    0x2e
00384 #define BNO055_GRAVITY_X_MSB    0x2f
00385 #define BNO055_GRAVITY_Y_LSB    0x30
00386 #define BNO055_GRAVITY_Y_MSB    0x31
00387 #define BNO055_GRAVITY_Z_LSB    0x32
00388 #define BNO055_GRAVITY_Z_MSB    0x33
00389 
00390 // Temperature data register
00391 #define BNO055_TEMP             0x34
00392 
00393 // Status registers
00394 #define BNO055_CALIB_STAT       0x35
00395 #define BNO055_SELFTEST_RESULT  0x36
00396 #define BNO055_INTR_STAT        0x37
00397 #define BNO055_SYS_CLK_STAT     0x38
00398 #define BNO055_SYS_STAT         0x39
00399 #define BNO055_SYS_ERR          0x3a
00400 
00401 // Unit selection register
00402 #define BNO055_UNIT_SEL         0x3b
00403 #define BNO055_DATA_SELECT      0x3c
00404 
00405 // Mode registers
00406 #define BNO055_OPR_MODE         0x3d
00407 #define BNO055_PWR_MODE         0x3e
00408 #define BNO055_SYS_TRIGGER      0x3f
00409 #define BNO055_TEMP_SOURCE      0x40
00410 
00411 // Axis remap registers
00412 #define BNO055_AXIS_MAP_CONFIG  0x41
00413 #define BNO055_AXIS_MAP_SIGN    0x42
00414 
00415 // SIC registers
00416 #define BNO055_SIC_MTRX_0_LSB   0x43
00417 #define BNO055_SIC_MTRX_0_MSB   0x44
00418 #define BNO055_SIC_MTRX_1_LSB   0x45
00419 #define BNO055_SIC_MTRX_1_MSB   0x46
00420 #define BNO055_SIC_MTRX_2_LSB   0x47
00421 #define BNO055_SIC_MTRX_2_MSB   0x48
00422 #define BNO055_SIC_MTRX_3_LSB   0x49
00423 #define BNO055_SIC_MTRX_3_MSB   0x4a
00424 #define BNO055_SIC_MTRX_4_LSB   0x4b
00425 #define BNO055_SIC_MTRX_4_MSB   0x4c
00426 #define BNO055_SIC_MTRX_5_LSB   0x4d
00427 #define BNO055_SIC_MTRX_5_MSB   0x4e
00428 #define BNO055_SIC_MTRX_6_LSB   0x4f
00429 #define BNO055_SIC_MTRX_6_MSB   0x50
00430 #define BNO055_SIC_MTRX_7_LSB   0x51
00431 #define BNO055_SIC_MTRX_7_MSB   0x52
00432 #define BNO055_SIC_MTRX_8_LSB   0x53
00433 #define BNO055_SIC_MTRX_8_MSB   0x54
00434 
00435 // Accelerometer Offset registers
00436 #define ACCEL_OFFSET_X_LSB      0x55
00437 #define ACCEL_OFFSET_X_MSB      0x56
00438 #define ACCEL_OFFSET_Y_LSB      0x57
00439 #define ACCEL_OFFSET_Y_MSB      0x58
00440 #define ACCEL_OFFSET_Z_LSB      0x59
00441 #define ACCEL_OFFSET_Z_MSB      0x5a
00442 
00443 // Magnetometer Offset registers
00444 #define MAG_OFFSET_X_LSB        0x5b
00445 #define MAG_OFFSET_X_MSB        0x5c
00446 #define MAG_OFFSET_Y_LSB        0x5d
00447 #define MAG_OFFSET_Y_MSB        0x5e
00448 #define MAG_OFFSET_Z_LSB        0x5f
00449 #define MAG_OFFSET_Z_MSB        0x60
00450 
00451 // Gyroscope Offset registers
00452 #define GYRO_OFFSET_X_LSB       0x61
00453 #define GYRO_OFFSET_X_MSB       0x62
00454 #define GYRO_OFFSET_Y_LSB       0x63
00455 #define GYRO_OFFSET_Y_MSB       0x64
00456 #define GYRO_OFFSET_Z_LSB       0x65
00457 #define GYRO_OFFSET_Z_MSB       0x66
00458 
00459 // Radius registers
00460 #define ACCEL_RADIUS_LSB        0x67
00461 #define ACCEL_RADIUS_MSB        0x68
00462 #define MAG_RADIUS_LSB          0x69
00463 #define MAG_RADIUS_MSB          0x6a
00464 
00465 //----- page1 ---------------------------------------------
00466 // Configuration registers
00467 #define ACCEL_CONFIG            0x08
00468 #define MAG_CONFIG              0x09
00469 #define GYRO_CONFIG             0x0a
00470 #define GYRO_MODE_CONFIG        0x0b
00471 #define ACCEL_SLEEP_CONFIG      0x0c
00472 #define GYRO_SLEEP_CONFIG       0x0d
00473 #define MAG_SLEEP_CONFIG        0x0e
00474 
00475 // Interrupt registers
00476 #define INT_MASK                0x0f
00477 #define INT                     0x10
00478 #define ACCEL_ANY_MOTION_THRES  0x11
00479 #define ACCEL_INTR_SETTINGS     0x12
00480 #define ACCEL_HIGH_G_DURN       0x13
00481 #define ACCEL_HIGH_G_THRES      0x14
00482 #define ACCEL_NO_MOTION_THRES   0x15
00483 #define ACCEL_NO_MOTION_SET     0x16
00484 #define GYRO_INTR_SETING        0x17
00485 #define GYRO_HIGHRATE_X_SET     0x18
00486 #define GYRO_DURN_X             0x19
00487 #define GYRO_HIGHRATE_Y_SET     0x1a
00488 #define GYRO_DURN_Y             0x1b
00489 #define GYRO_HIGHRATE_Z_SET     0x1c
00490 #define GYRO_DURN_Z             0x1d
00491 #define GYRO_ANY_MOTION_THRES   0x1e
00492 #define GYRO_ANY_MOTION_SET     0x1f
00493 
00494 //---------------------------------------------------------
00495 //----- Calibration example -------------------------------
00496 //---------------------------------------------------------
00497 #if 0
00498 // Calibration
00499 //  Please refer BNO055 Data sheet 3.10 Calibration & 3.6.4 Sensor calibration data
00500 void bno055_calbration(void){
00501     uint8_t d;
00502 
00503     pc.printf("------ Enter BNO055 Manual Calibration Mode ------\r\n");
00504     //---------- Gyroscope Caliblation ------------------------------------------------------------
00505     // (a) Place the device in a single stable position for a period of few seconds to allow the
00506     //     gyroscope to calibrate
00507     pc.printf("Step1) Please wait few seconds\r\n");
00508     t.start();
00509     while (t.read() < 10){
00510         d = imu.read_calib_status();
00511         pc.printf("Calb dat = 0x%x target  = 0x30(at least)\r\n", d);
00512         if ((d & 0x30) == 0x30){
00513             break;
00514         }
00515         wait(1.0);
00516     }
00517     pc.printf("-> Step1) is done\r\n\r\n");
00518     //---------- Magnetometer Caliblation ---------------------------------------------------------
00519     // (a) Make some random movements (for example: writing the number ‘8’ on air) until the
00520     //     CALIB_STAT register indicates fully calibrated.
00521     // (b) It takes more calibration movements to get the magnetometer calibrated than in the
00522     //     NDOF mode.
00523     pc.printf("Step2) random moving (try to change the BNO055 axis)\r\n");
00524     t.start();
00525     while (t.read() < 30){
00526         d = imu.read_calib_status();
00527         pc.printf("Calb dat = 0x%x target  = 0x33(at least)\r\n", d);
00528         if ((d & 0x03) == 0x03){
00529             break;
00530         }
00531         wait(1.0);
00532     }
00533     pc.printf("-> Step2) is done\r\n\r\n");
00534     //---------- Magnetometer Caliblation ---------------------------------------------------------
00535     // a) Place the device in 6 different stable positions for a period of few seconds
00536     //    to allow the accelerometer to calibrate.
00537     // b) Make sure that there is slow movement between 2 stable positions
00538     //    The 6 stable positions could be in any direction, but make sure that the device is
00539     //    lying at least once perpendicular to the x, y and z axis.
00540     pc.printf("Step3) Change rotation each X,Y,Z axis KEEP SLOWLY!!");
00541     pc.printf(" Each 90deg stay a 5 sec and set at least 6 position.\r\n");
00542     pc.printf(" e.g. (1)ACC:X0,Y0,Z-9,(2)ACC:X9,Y0,Z0,(3)ACC:X0,Y0,Z9,");
00543     pc.printf("(4)ACC:X-9,Y0,Z0,(5)ACC:X0,Y-9,Z0,(6)ACC:X0,Y9,Z0,\r\n");
00544     pc.printf(" If you will give up, hit any key.\r\n", d);
00545     t.stop();
00546     while (true){
00547         d = imu.read_calib_status();
00548         imu.get_gravity(&gravity);
00549         pc.printf("Calb dat = 0x%x target  = 0xff ACC:X %3.0f, Y %3.0f, Z %3.0f\r\n",
00550                    d, gravity.x, gravity.y, gravity.z);
00551         if (d == 0xff){     break;}
00552         if (pc.readable()){ break;}
00553         wait(1.0);
00554     }
00555     if (imu.read_calib_status() == 0xff){
00556         pc.printf("-> All of Calibration steps are done successfully!\r\n\r\n");
00557     } else {
00558         pc.printf("-> Calibration steps are suspended!\r\n\r\n");
00559     }
00560     t.stop();
00561 }
00562 #endif
00563 
00564 #endif      // BNO055_H