 
     /*Serial.print(F("BMP085 connecting"));
     if (bmp.begin(BMP085_MODE_STANDARD))
-        Serial.print(F("BMP085 connection succeeded"));
+    Serial.print(F("BMP085 connection succeeded"));
     else
-        Serial.print(F("BMP085 connection failed"));*/
+    Serial.print(F("BMP085 connection failed"));*/
 
 #endif
 }

#define TRIGGER_SERVO_ANGLE 90
#define RESET_SERVO_ANGLE 0

// Should be a PWM pin
uint8_t servoPin = 5;
Servo actuationServo;


// Parameter is sensor ID
Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);

        float temperature;
        bmp.getTemperature(&temperature);

        float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;

        float currentAlt = bmp.pressureToAltitude(seaLevelPressure, event.pressure, temperature);
        return smoothAltitude(currentAlt);
    }

    return -1;
}
float smoothAltitude(float newAlt) {
    // cycle every time this is called
    lastAltitudes[lastAltitudeIndex] = newAlt;
    lastAltitudeIndex++;
    if (lastAltitudeIndex >= ALTITUDE_SMOOTHING) {
        lastAltitudeIndex = 0;
    }

    // get average
    float sum = 0;
    for (int i = 0; i < ALTITUDE_SMOOTHING; i++) {
        sum += lastAltitudes[i];
    }
    return sum / ALTITUDE_SMOOTHING;
}

#endif
