Access different power mode of BNO055 via nRF51-DK BLE

Dependencies:   BLE_API BNO055 mbed nRF51822 nrf51_rtc

Fork of BLE_LoopbackUART_with_LSM6DS3 by Sherry Yang

Revision:
1:7562cc147e26
Parent:
0:d0291b4a856a
Child:
2:514af7294ad0
diff -r d0291b4a856a -r 7562cc147e26 main.cpp
--- a/main.cpp	Fri Jun 17 22:14:12 2016 +0000
+++ b/main.cpp	Mon Jun 20 19:29:09 2016 +0000
@@ -18,9 +18,9 @@
 #include "ble/BLE.h"
 
 #include "ble/services/UARTService.h"
-#include "LSM9DS1/LSM9DS1.h"
+#include "LSM6DS3/LSM6DS3.h"
 
-LSM9DS1 imu(p30, p7);
+LSM6DS3 imu(p30, p7);
 Serial pc(p9, p11);
 
 #define NEED_CONSOLE_OUTPUT 1 /* Set this if you need debug messages on the console;
@@ -56,26 +56,26 @@
         switch(value) {
             case 49:
                 DEBUG("Off power\n\r");
-                status = imu.begin(imu.G_SCALE_245DPS, imu.A_SCALE_2G, imu.M_SCALE_4GS,
-                                            imu.G_POWER_DOWN, imu.A_POWER_DOWN, imu.M_ODR_0625);
+                status = imu.begin(imu.G_SCALE_245DPS, imu.A_SCALE_2G,
+                                   imu.G_POWER_DOWN, imu.A_POWER_DOWN);
                 break;
             case 50:
                 DEBUG("Low power\n\r");
-                status = imu.begin(imu.G_SCALE_245DPS, imu.A_SCALE_2G, imu.M_SCALE_4GS,
-                                            imu.G_ODR_15_BW_0, imu.A_POWER_DOWN, imu.M_ODR_0625);
+                status = imu.begin(imu.G_SCALE_245DPS, imu.A_SCALE_2G,
+                                   imu.G_ODR_13_BW_0, imu.A_ODR_13);
                 break;
             case 51:
                 DEBUG("High power\n\r");
-                status = imu.begin(imu.G_SCALE_2000DPS, imu.A_SCALE_8G, imu.M_SCALE_16GS,
-                                            imu.G_ODR_952_BW_100, imu.A_ODR_952, imu.M_ODR_80);
+                status = imu.begin(imu.G_SCALE_2000DPS, imu.A_SCALE_8G,
+                                   imu.G_ODR_1660, imu.A_ODR_6660);
                 break;
             default:
                 DEBUG("Nothing happened\n\r");
                 break;
         }
                 
-        pc.printf("LSM9DS1 WHO_AM_I's returned: 0x%X\r\n", status);
-        pc.printf("Should be 0x683D\r\n");
+        pc.printf("LSM6DS3 WHO_AM_I's returned: 0x%X\r\n", status);
+        pc.printf("Should be 0x69\r\n");
         
         ble.updateCharacteristicValue(uartServicePtr->getRXCharacteristicHandle(), params->data, bytesRead);
     }