summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-11-02 20:58:47 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-11-02 20:58:47 +0100
commite90590be17d3c5fe02f8b5d16edc987e81ca0730 (patch)
tree81595e94eb585c72c98a0347edbf1d1177351ff0 /src/app
parent332affa882cfb48d6056dd5bf07af6ef221d200d (diff)
mpu9250 motionlog: fix min/max calculation, decrease update rate
Diffstat (limited to 'src/app')
-rw-r--r--src/app/mpu9250_motionlog/main.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/app/mpu9250_motionlog/main.cc b/src/app/mpu9250_motionlog/main.cc
index 9bdfe0c..62af28f 100644
--- a/src/app/mpu9250_motionlog/main.cc
+++ b/src/app/mpu9250_motionlog/main.cc
@@ -20,7 +20,7 @@ int main(void)
INIT0(gx);
INIT0(gy);
INIT0(gz);
- unsigned char i = 0;
+ unsigned short i = 0;
arch.setup();
gpio.setup();
@@ -52,16 +52,16 @@ int main(void)
UPDATE_MAX(max_gy, gy);
UPDATE_MAX(max_gz, gz);
- if (i++ == 200) {
+ if (i++ == 2000) {
kout << "Min Accel: " << min_ax << " / " << min_ay << " / " << min_az << endl;
kout << "Max Accel: " << max_ax << " / " << max_ay << " / " << max_az << endl;
kout << "Min Gyro: " << min_gx << " / " << min_gy << " / " << min_gz << endl;
kout << "Max Gyro: " << max_gx << " / " << max_gy << " / " << max_gz << endl;
kout << "Temp: " << mpu9250.getTemperature() << endl;
- min_ax = min_ay = min_az = 0;
- min_gx = min_gy = min_gz = 0;
- max_ax = max_ay = max_az = 0;
- max_gx = max_gy = max_gz = 0;
+ min_ax = min_ay = min_az = 30000;
+ min_gx = min_gy = min_gz = 30000;
+ max_ax = max_ay = max_az = -30000;
+ max_gx = max_gy = max_gz = -30000;
i = 0;
}
arch.delay_ms(1);