Skip to content

Commit

Permalink
add in IIR filter and increase pressure oversampling
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-goddard committed Apr 13, 2024
1 parent fb54e6f commit 60db22b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bmp388.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ bool BMP388::read_pressure(float *pressure) {
settings.press_en = BMP3_ENABLE;
settings.temp_en = BMP3_ENABLE;

settings.odr_filter.press_os = BMP3_OVERSAMPLING_2X;
settings.odr_filter.temp_os = BMP3_OVERSAMPLING_2X;
settings.odr_filter.odr = BMP3_ODR_100_HZ;
settings.odr_filter.press_os = BMP3_OVERSAMPLING_8X;
settings.odr_filter.temp_os = BMP3_NO_OVERSAMPLING;
settings.odr_filter.odr = BMP3_ODR_50_HZ;
settings.odr_filter.iir_filter = BMP3_IIR_FILTER_COEFF_3;

settings_sel = BMP3_SEL_PRESS_EN | BMP3_SEL_TEMP_EN | BMP3_SEL_PRESS_OS | BMP3_SEL_TEMP_OS | BMP3_SEL_ODR |
BMP3_SEL_DRDY_EN;
BMP3_SEL_DRDY_EN | BMP3_SEL_IIR_FILTER;

ret = bmp3_set_sensor_settings(settings_sel, &settings, &device);
if (ret != BMP3_OK) {
Expand Down

0 comments on commit 60db22b

Please sign in to comment.