Exemplo n.º 1
0
void sensorsInit(void)
{
    zeroSensorAccumulators();

    // TODO allow user to select hardware if there are multiple choices

    if(mpu6050Detect(&gyro, &accel, cfg.mpu6050Scale)) {
        sensorsSet(SENSOR_ACC);
    } else if(!mpu3050Detect(&gyro)) {
        failureMode(3);
    }

    if(adxl345Detect(&accel)) {
        sensorsSet(SENSOR_ACC);
    }

    // At the moment we will do this after mpu6050 and overrride mpu6050 accel if detected
    if(mma8452Detect(&accel)) {
        sensorsSet(SENSOR_ACC);
    }

    gyro.init();

    if(sensorsGet(SENSOR_ACC))
        accel.init();

    if(hmc5883Detect(&mag)) {
        mag.init();
        sensorsSet(SENSOR_MAG);
    }

#ifdef SONAR
    if(feature(FEATURE_PPM);) {
Exemplo n.º 2
0
void Mag_init(void)
{
    // initialize and calibration. turn on led during mag calibration (calibration routine blinks it)
    LED1_ON;
    mag.init(mcfg.mag_align);
    LED1_OFF;
    magInit = 1;
}
Exemplo n.º 3
0
void compassInit(void)
{
    // initialize and calibration. turn on led during mag calibration (calibration routine blinks it)
    LED1_ON;
    mag.init();
    LED1_OFF;
    magInit = 1;
}