aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers/mpu6000/mpu6000.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-08-27 09:08:34 +0200
committerLorenz Meier <lm@inf.ethz.ch>2012-08-27 09:08:34 +0200
commit248bb11d933cae03d7e57f0b746fd416204c2b3d (patch)
treedcedc766761dc3d9cc097b3a06edc4d05d9c71e3 /apps/drivers/mpu6000/mpu6000.cpp
parent58b51743f2886120062056a12f9f52ef0e77653a (diff)
downloadpx4-firmware-248bb11d933cae03d7e57f0b746fd416204c2b3d.tar.gz
px4-firmware-248bb11d933cae03d7e57f0b746fd416204c2b3d.tar.bz2
px4-firmware-248bb11d933cae03d7e57f0b746fd416204c2b3d.zip
removed stop() from I2C driver startup routines, work in progress on MPU scaling
Diffstat (limited to 'apps/drivers/mpu6000/mpu6000.cpp')
-rw-r--r--apps/drivers/mpu6000/mpu6000.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/drivers/mpu6000/mpu6000.cpp b/apps/drivers/mpu6000/mpu6000.cpp
index cb526d52a..3987e13cc 100644
--- a/apps/drivers/mpu6000/mpu6000.cpp
+++ b/apps/drivers/mpu6000/mpu6000.cpp
@@ -831,7 +831,7 @@ MPU6000::measure()
report.temp = (((int16_t)mpu_report.temp[0]) << 8) | mpu_report.temp[1];
- report.gyro_x = ((int16_t)(mpu_report.gyro_x[0]) << 8) | mpu_report.gyro_x[1];
+ report.gyro_x = int16_t_from_bytes(mpu_report.gyro_x);
report.gyro_y = ((int16_t)(mpu_report.gyro_y[0]) << 8) | mpu_report.gyro_y[1];
report.gyro_z = ((int16_t)(mpu_report.gyro_z[0]) << 8) | mpu_report.gyro_z[1];
@@ -839,7 +839,7 @@ MPU6000::measure()
* Swap axes and negate y
*/
int16_t accel_xt = report.accel_y;
- int16_t accel_yt = ((report.accel_x == -32768) ? 32767 : -report.accel_x);
+ int16_t accel_yt = report.accel_x;//((report.accel_x == -32768) ? 32767 : -report.accel_x);
int16_t gyro_xt = report.gyro_y;
int16_t gyro_yt = ((report.gyro_x == -32768) ? 32767 : -report.gyro_x);
@@ -1030,9 +1030,9 @@ test()
warnx("acc x: \t%8.4f\tm/s^2", (double)a_report.x);
warnx("acc y: \t%8.4f\tm/s^2", (double)a_report.y);
warnx("acc z: \t%8.4f\tm/s^2", (double)a_report.z);
- warnx("acc x: \t%d\traw", (int)a_report.x_raw);
- warnx("acc y: \t%d\traw", (int)a_report.y_raw);
- warnx("acc z: \t%d\traw", (int)a_report.z_raw);
+ warnx("acc x: \t%d\traw 0x%0x", (short)a_report.x_raw, (unsigned short)a_report.x_raw);
+ warnx("acc y: \t%d\traw 0x%0x", (short)a_report.y_raw, (unsigned short)a_report.y_raw);
+ warnx("acc z: \t%d\traw 0x%0x", (short)a_report.z_raw, (unsigned short)a_report.z_raw);
warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
(double)(a_report.range_m_s2 / 9.81f));