Changing the sample frequency of the BMM150 magnetometer on the Nano 33 BLE Sense Rev2

72 views Asked by At

I am working with inertial data using the Arduino Nano 33 BLE Sense Rev2 board. I have used various libraries, and the one that enables me to access the data effectively is 'Arduino_BMI270_BMM150.h' by Arduino. However, I have been unsuccessful in my attempts to change the sampling frequency of the magnetometer.

Below are a few lines of code from 'Arduino_BMI270_BMM150/src/utilities/BMM150-Sensor-API' that I have modified.

line 808 from settings->data_rate = BMM150_DATA_RATE_10HZ; to settings->data_rate = BMM150_DATA_RATE_30HZ;

line 818 from settings->data_rate = BMM150_DATA_RATE_10HZ; to settings->data_rate = BMM150_DATA_RATE_30HZ;

line 828 from settings->data_rate = BMM150_DATA_RATE_10HZ; to settings->data_rate = BMM150_DATA_RATE_30HZ;

line 838 from settings->data_rate = BMM150_DATA_RATE_10HZ; to settings->data_rate = BMM150_DATA_RATE_30HZ;

line 1338 from reg_data = BMM150_SET_BITS(reg_data, BMM150_ODR, settings->data_rate); to reg_data = BMM150_SET_BITS(reg_data, BMM150_ODR, BMM150_DATA_RATE_30HZ);

line 1471 from settings->data_rate = BMM150_GET_BITS(reg_data[1], BMM150_ODR); to settings->data_rate = BMM150_DATA_RATE_30HZ;

When I use 'Serial.print(IMU.magneticFieldSampleRate())', I get as output '30', but the serial plotter still provides the standard rate of 10 values per second.

Any suggestions are truly appreciated. Thank you very much in advance.

0

There are 0 answers