From 9b19acc4b759b5c16d65c16c1b6e15d781f8116d Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Mon, 23 Mar 2015 17:23:17 +1100 Subject: Add support for MPU-9150 --- megalogger/config.h | 1 + megalogger/megalogger.ino | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'megalogger') diff --git a/megalogger/config.h b/megalogger/config.h index 24b456f..9a4d8c1 100644 --- a/megalogger/config.h +++ b/megalogger/config.h @@ -53,6 +53,7 @@ //#define USE_MPU9150 1 #define ACC_DATA_RATIO 160 #define GYRO_DATA_RATIO 256 +#define COMPASS_DATA_RATIO 8 /************************************** * Timeout/interval options diff --git a/megalogger/megalogger.ino b/megalogger/megalogger.ino index 22ba948..6def771 100644 --- a/megalogger/megalogger.ino +++ b/megalogger/megalogger.ino @@ -475,7 +475,11 @@ void processAccelerometer() gx /= GYRO_DATA_RATIO; gy /= GYRO_DATA_RATIO; gz /= GYRO_DATA_RATIO; - +#if USE_MPU9150 + mx /= COMPASS_DATA_RATIO; + my /= COMPASS_DATA_RATIO; + mz /= COMPASS_DATA_RATIO; +#endif // display MEMS data lcd.setFontSize(FONT_SIZE_SMALL); lcd.setCursor(214, 22); -- cgit v1.2.3