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
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
Diff: BNO055.cpp
- Revision:
- 13:92854c8deb3c
- Parent:
- 11:17bc36c5ccbb
- Child:
- 14:9f9a12bcd8ed
--- a/BNO055.cpp Mon Jan 29 14:28:06 2018 +0000 +++ b/BNO055.cpp Thu Feb 01 00:16:59 2018 +0100 @@ -27,6 +27,7 @@ { chip_addr = addr; chip_mode = mode; + initialize_reset_pin(); initialize (); } @@ -35,6 +36,7 @@ { chip_addr = BNO055_G_CHIP_ADDR; chip_mode = MODE_NDOF; + initialize_reset_pin(); initialize (); } @@ -43,6 +45,7 @@ { chip_addr = addr; chip_mode = mode; + initialize_reset_pin(); initialize (); } @@ -51,6 +54,7 @@ { chip_addr = BNO055_G_CHIP_ADDR; chip_mode = MODE_NDOF; + initialize_reset_pin(); initialize (); } @@ -260,6 +264,12 @@ change_fusion_mode(chip_mode); } +void BNO055::initialize_reset_pin(void) +{ + _res = 1; + WAIT_MS(700); // Need to wait at least 650mS +} + void BNO055::unit_selection(void) { select_page(0);