diff --git a/libraries/AP_Compass/examples/AP_Compass_test/AP_Compass_test.pde b/libraries/AP_Compass/examples/AP_Compass_test/AP_Compass_test.pde index efd6beff56..f4aac4ca50 100644 --- a/libraries/AP_Compass/examples/AP_Compass_test/AP_Compass_test.pde +++ b/libraries/AP_Compass/examples/AP_Compass_test/AP_Compass_test.pde @@ -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