Modified LSM9DS1 Library

Dependents:   LSM9DS1_Demo BLE_LoopbackUART_with_LSM9DS1 BLE_LoopbackUART_with_LSM9DS1-2

Fork of LSM9DS1 by Eugene Gonzalez

Revision:
2:ac3b69ccd3dd
Parent:
0:622e8874902e
Child:
3:f96b287c0bf7
--- a/LSM9DS1.cpp	Mon Oct 19 13:56:52 2015 +0000
+++ b/LSM9DS1.cpp	Fri Jun 17 21:12:22 2016 +0000
@@ -276,11 +276,19 @@
 
 void LSM9DS1::setGyroODR(gyro_odr gRate)
 {
+    char cmd[2];
+    char cmdLow[2];
+    
+    if(gRate == G_ODR_15_BW_0 | gRate == G_ODR_60_BW_16 | gRate == G_ODR_119_BW_14 | gRate == G_ODR_119_BW_31) {
+        cmdLow[0] = CTRL_REG3_G;
+        cmdLow[1] = 1;
+        
+        i2c.write(xgAddress, cmdLow, 2);
+    }
+    
     // The start of the addresses we want to read from
-    char cmd[2] = {
-        CTRL_REG1_G,
-        0
-    };
+    cmd[0] = CTRL_REG1_G;
+    cmd[1] = 0;
 
     // Write the address we are going to read from and don't end the transaction
     i2c.write(xgAddress, cmd, 1, true);