From 0f5d01b563ec1e6f12de65f3e84ac96ccb541abf Mon Sep 17 00:00:00 2001 From: "rmackay9@yahoo.com" Date: Sun, 26 Sep 2010 13:55:47 +0000 Subject: [PATCH] added magnetometer orientation functionality to APM_Compass which requires small change to ArduCopter.pde to include AP_Math. git-svn-id: https://arducopter.googlecode.com/svn/trunk@561 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- Arducopter/Arducopter.pde | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Arducopter/Arducopter.pde b/Arducopter/Arducopter.pde index 0bba456bae..77693f676b 100644 --- a/Arducopter/Arducopter.pde +++ b/Arducopter/Arducopter.pde @@ -105,6 +105,7 @@ #include #include #include +#include #ifdef UseBMP #include #endif @@ -370,8 +371,10 @@ void setup() if(pitch_mid < 1400 || pitch_mid > 1600) pitch_mid = 1500; if(yaw_mid < 1400 || yaw_mid > 1600) yaw_mid = 1500; - if (MAGNETOMETER == 1) + if (MAGNETOMETER == 1) { APM_Compass.Init(); // I2C initialization + APM_Compass.SetOrientation(APM_COMPASS_COMPONENTS_UP_PINS_BACK); + } DataFlash.StartWrite(1); // Start a write session on page 1