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

Please note: pitch and roll in get_euler_angles are switched, the code should be like this:

h = dt[1] << 8 | dt[0]; r = dt[3] << 8 | dt[2]; p = dt[5] << 8 | dt[4];

See https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bno055-ds000.pdf

Revision:
2:0f225b686cd5
Parent:
1:cb7e19c0a702
Child:
3:0ad6f85b178f
--- a/BNO055.cpp	Tue Apr 07 12:03:58 2015 +0000
+++ b/BNO055.cpp	Wed Apr 08 11:27:57 2015 +0000
@@ -7,7 +7,7 @@
  *  http://www.page.sannet.ne.jp/kenjia/index.html
  *  http://mbed.org/users/kenjiArai/
  *      Created: March     30th, 2015
- *      Revised: April      7th, 2015
+ *      Revised: April      8th, 2015
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
@@ -306,7 +306,7 @@
 }
 
 /////////////// Check chip ready or not  //////////////////
-uint8_t BNO055::chip_ready()
+uint8_t BNO055::chip_ready(void)
 {
     if (ready_flg == 0x0f) {
         return 1;
@@ -314,6 +314,16 @@
     return 0;
 }
 
+/////////////// Read Calibration status  //////////////////
+uint8_t BNO055::read_calib_status(void)
+{
+    select_page(0);
+    dt[0] = BNO055_CALIB_STAT;
+    _i2c.write(chip_addr, dt, 1, true);
+    _i2c.read(chip_addr, dt, 1, false);
+    return dt[0];
+}
+
 /////////////// Change Fusion mode  ///////////////////////
 void BNO055::change_fusion_mode(uint8_t mode)
 {