L3GD20 & L3G4200D / STMicroelectronics / MEMS motion sensor, three-axis gyroscope library
Dependents: GR-PEACH_test_wo_rtos GR-PEACH_test_on_rtos_works_well
Diff: L3GD20.cpp
- Revision:
- 3:56bb957380c8
- Parent:
- 2:8073008f3036
- Child:
- 4:7d0cec583aa3
--- a/L3GD20.cpp Sun Dec 07 08:26:58 2014 +0000 +++ b/L3GD20.cpp Sat Dec 27 07:39:33 2014 +0000 @@ -94,8 +94,8 @@ // In other words, SUB(7) must be equal to ‘1’ while SUB(6-0) represents the address // of the first register to be read. dbf[0] = L3GX_OUT_X_L | 0x80; - i2c.write(gyro_addr, dbf, 1); - i2c.read(gyro_addr, data, 6); + i2c.write(gyro_addr, dbf, 1, true); + i2c.read(gyro_addr, data, 6, false); // data normalization dt[0] = float(short(data[1] << 8 | data[0])) * fs_factor; dt[1] = float(short(data[3] << 8 | data[2])) * fs_factor;