Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: measure_1_BBB measure_1_CCC measure_1_DDD
Diff: MPU6050.cpp
- Revision:
- 2:8622f361c1a4
- Parent:
- 1:c9dc906f8b9f
--- a/MPU6050.cpp Thu May 13 05:11:28 2021 +0000
+++ b/MPU6050.cpp Fri May 14 00:48:09 2021 +0000
@@ -72,6 +72,17 @@
}
return false;
}
+bool MPU6050::readraw2(int16_t *ax, int16_t *ay, int16_t *az)
+{
+ char data2[6];
+ if (read_data(ADDRESS, MPU6050_ACCEL_XOUT_H, data2, 6)) {
+ *ax = short(data2[0] << 8 | data2[1]);
+ *ay = short(data2[2] << 8 | data2[3]);
+ *az = short(data2[4] << 8 | data2[5]);
+ return true;
+ }
+ return false;
+}
bool MPU6050::write_reg(int addr_i2c,int addr_reg, char v)
{
char data[2] = {addr_reg, v};