aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-08-22 16:20:05 +0200
committerLorenz Meier <lm@inf.ethz.ch>2012-08-22 16:20:05 +0200
commit5f259e41d563a786777785072306ca5b5763ec79 (patch)
tree2beb2e22c2aa8462f51e3dd998fdc322a77fd789 /apps/drivers
parentfa9f145b08cace0f48c808cf307daf6cd43d9bd6 (diff)
parent1530aeccae706fe8024b4de2293060539c01ceaa (diff)
downloadpx4-firmware-5f259e41d563a786777785072306ca5b5763ec79.tar.gz
px4-firmware-5f259e41d563a786777785072306ca5b5763ec79.tar.bz2
px4-firmware-5f259e41d563a786777785072306ca5b5763ec79.zip
Sensor readout, testing and driver adjustments
Diffstat (limited to 'apps/drivers')
-rw-r--r--apps/drivers/mpu6000/mpu6000.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/drivers/mpu6000/mpu6000.cpp b/apps/drivers/mpu6000/mpu6000.cpp
index 951e1a062..999790e8a 100644
--- a/apps/drivers/mpu6000/mpu6000.cpp
+++ b/apps/drivers/mpu6000/mpu6000.cpp
@@ -288,9 +288,9 @@ MPU6000::MPU6000(int bus, spi_dev_e device) :
_gyro(new MPU6000_gyro(this)),
_product(0),
_call_interval(0),
- _accel_range_scale(1.0f),
+ _accel_range_scale(0.02f),
_accel_topic(-1),
- _gyro_range_scale(1.0f),
+ _gyro_range_scale(0.02f),
_gyro_topic(-1),
_reads(0),
_sample_perf(perf_alloc(PC_ELAPSED, "mpu6000_read"))
@@ -826,7 +826,7 @@ test()
fd = open(ACCEL_DEVICE_PATH, O_RDONLY);
if (fd < 0) {
- reason = "can't open driver";
+ reason = "can't open driver, use <mpu6000 start> first";
break;
}
@@ -841,9 +841,10 @@ test()
printf("single read\n");
fflush(stdout);
printf("time: %lld\n", report.timestamp);
- printf("x: %f\n", report.x);
- printf("y: %f\n", report.y);
- printf("z: %f\n", report.z);
+ printf("x: %5.2f\n", (double)report.x);
+ printf("y: %5.2f\n", (double)report.y);
+ printf("z: %5.2f\n", (double)report.z);
+ printf("test: %8.4f\n", 1.5);
} while (0);