From 614aeb274cad162749e4218566cdb9d3a98f2c4e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Dec 2011 15:29:22 +1100 Subject: [PATCH] fixed build of IMU_MPU6000_test --- .../examples/IMU_MPU6000_test/IMU_MPU6000_test.pde | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libraries/AP_IMU/examples/IMU_MPU6000_test/IMU_MPU6000_test.pde b/libraries/AP_IMU/examples/IMU_MPU6000_test/IMU_MPU6000_test.pde index eff70c898b..bde68269e9 100644 --- a/libraries/AP_IMU/examples/IMU_MPU6000_test/IMU_MPU6000_test.pde +++ b/libraries/AP_IMU/examples/IMU_MPU6000_test/IMU_MPU6000_test.pde @@ -21,6 +21,17 @@ AP_TimerProcess mpu_scheduler; AP_InertialSensor_MPU6000 mpu6000( 53 ); /* chip select is pin 53 */ AP_IMU_INS imu(&mpu6000, 0); /* second arg is for Parameters. Can we leave it null?*/ +#define A_LED_PIN 27 +#define C_LED_PIN 25 +#define LED_ON LOW +#define LED_OFF HIGH + +static void flash_leds(bool on) +{ + digitalWrite(A_LED_PIN, on?LED_OFF:LED_ON); + digitalWrite(C_LED_PIN, on?LED_ON:LED_OFF); +} + void setup(void) { pinMode(53, OUTPUT); @@ -32,7 +43,7 @@ void setup(void) isr_registry.init(); mpu_scheduler.init(&isr_registry); - imu.init(IMU::COLD_START, delay, &mpu_scheduler); + imu.init(IMU::COLD_START, delay, flash_leds, &mpu_scheduler); } void loop(void)