fixed build of IMU_MPU6000_test

This commit is contained in:
Andrew Tridgell 2011-12-21 15:29:22 +11:00
parent ace823fccf
commit 614aeb274c
1 changed files with 12 additions and 1 deletions

View File

@ -21,6 +21,17 @@ AP_TimerProcess mpu_scheduler;
AP_InertialSensor_MPU6000 mpu6000( 53 ); /* chip select is pin 53 */ 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?*/ 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) void setup(void)
{ {
pinMode(53, OUTPUT); pinMode(53, OUTPUT);
@ -32,7 +43,7 @@ void setup(void)
isr_registry.init(); isr_registry.init();
mpu_scheduler.init(&isr_registry); 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) void loop(void)