DroneOS/Drivers/Source/drvMS5611.c
/**
 * Converts pressure to altitude above sea level (ASL) in meters
 */
Converts pressure to altitude above sea level (ASL) in meters
Converts pressure to altitude above sea level ( ASL ) in meters
float ms5611PressureToAltitude(float* pressure)
{
    if (*pressure > 0)
    {
        return ((pow((1015.7 / *pressure), CONST_PF) - 1.0) * (FIX_TEMP + 273.15)) / 0.0065;
    }
    else
    {
        return 0;
    }
}
float ms5611PressureToAltitude ( float * pressure ) { if ( * pressure > 0 ) { return ( ( pow ( ( 1015.7 / * pressure ) , CONST_PF ) - 1.0 ) * ( FIX_TEMP + 273.15 ) ) / 0.0065 ; } else { return 0 ; } }
Converts pressure to altitude above sea level (ASL) in meters
Converts pressure to altitude above sea level ( ASL ) in meters
/*, float* ground_pressure, float* ground_temp*/ //return (1.f - pow(*pressure / CONST_SEA_PRESSURE, CONST_PF)) * CONST_PF2; //return ((pow((1015.7 / *pressure), CONST_PF) - 1.0) * (25. + 273.15)) / 0.0065;