AP_Compass: report compass initialisation failure

don't just put out rubbish values

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2717 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
tridge60@gmail.com 2011-07-02 11:31:27 +00:00
parent fd2547216d
commit e9bb030fd4
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ void setup()
Serial.begin(115200);
Serial.println("Compass library test (HMC5843 and HMC5883L)");
Wire.begin();
compass.init(); // Initialization
if (!compass.init()) {
Serial.println("compass initialisation failed!");
while (1) ;
}
compass.set_orientation(AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD); // set compass's orientation on aircraft.
compass.set_offsets(0,0,0); // set offsets to account for surrounding interference