Forgot to get rid of the first four LSB bits in the pressure raw data. Pressure reading is now correct !

This commit is contained in:
Th3maz1ng 2023-01-14 13:17:46 +01:00
parent 3171f23179
commit 7117ac348c

View File

@ -150,6 +150,7 @@ float BMP280_get_pressure(float * const temperature)
if(!i2c_read(BMP280_I2C_ADDR, BMP280_PRESS_MSB, data, sizeof data)) return 0.0f;
int32_t adc_P = data[0] << 16 | data[1] << 8 | data[2];
adc_P >>= 4;
var1 = ((int64_t)t_fine) - 128000;
var2 = var1 * var1 * (int64_t)_calibration_data.dig_P6;