BNO055 Library with interrupt

Dependents:   BLE_LoopbackUART_with_BNO055

Fork of BNO055 by Dave Turner

Files at this revision

API Documentation at this revision

Comitter:
5hel2l2y
Date:
Mon Jul 11 18:01:41 2016 +0000
Parent:
8:303717d8776c
Commit message:
Modified power modes.

Changed in this revision

BNO055.cpp Show annotated file Show diff for this revision Revisions of this file
BNO055.h Show annotated file Show diff for this revision Revisions of this file
diff -r 303717d8776c -r f43b1aa99e08 BNO055.cpp
--- a/BNO055.cpp	Thu Jun 23 22:28:41 2016 +0000
+++ b/BNO055.cpp	Mon Jul 11 18:01:41 2016 +0000
@@ -312,4 +312,28 @@
     setpage(0);
     readchar(BNO055_INTR_STAT_ADDR);
     intr = rx;
+}
+
+void BNO055::setpowermode3() {
+    setmode(OPERATION_MODE_CONFIG);
+    wait_ms(20);
+    setpage(1);
+    // 1.  Accelerometer High
+    // 1a. Set Range
+    writechar(0x08, ((0 & ~(0x03)) | ((0x03 << 0) & 0x03)));
+    // 1b. Set Power
+    writechar(0x08, ((0 & ~(0xE0)) | ((0x00 << 5) & 0xE0)));
+    
+    // 2.  Gyro Off
+    // 2a. Set Range
+    writechar(0x0B, ((0 & ~(0x07)) | ((0x00 << 0) & 0x07)));
+    // 2b. Set Power
+    writechar(0x0B, ((0 & ~(0x07)) | ((0x02 << 0) & 0x07)));
+    
+    // 3.  Magnetometer Low
+    // 3a. Set Power
+    writechar(0x09, ((0 & ~(0x60)) | ((0x00 << 5) & 0x60)));
+
+    // turn page back to 0 for reading op mode
+    setpage(0);
 }
\ No newline at end of file
diff -r 303717d8776c -r f43b1aa99e08 BNO055.h
--- a/BNO055.h	Thu Jun 23 22:28:41 2016 +0000
+++ b/BNO055.h	Mon Jul 11 18:01:41 2016 +0000
@@ -239,6 +239,8 @@
 /** Reset the interrupt  **/
     void resetIntr();
     
+    void setpowermode3();
+    
 /** Structures containing 3-axis data for acceleration, rate of turn and magnetic field.
     x,y,z are the scale floating point values and
     rawx, rawy, rawz are the int16_t values read from the sensors **/