VGR
Dependents: VITI_motor_angle_1 VITI_motor_angle_2 VITI_motor_angle_3
Diff: LSM9DS1.cpp
- 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);