Sampling magnometer
I found thie following command to create a magnometer sampels at 20Hz rate:
mbl_mw_mag_bmm150_configure ( const MblMwMetaWearBoard * board,
uint16_t xy_reps,
uint16_t z_reps,
MblMwMagBmm150Odr odr
)
but im not sure what are those fields:
uint16_t xy_reps,
uint16_t z_reps,
what should I enter if i want to have magnometer samples at 20Hz rate?
Comments
Please don't use this, it is for advanced users only (you can skip it).
so can you tell me what line of code is needed in order to set the magnometer sampling rate?
You are right, the only way to change the sample rate of the mag (which we don't recommend, we prefer people use the defaul) is to use "mbl_mw_mag_bmm150_configure".
The data types for the configure API call:
The way the magnetomter works is by oversampling (repeat measurement). This is how it gets better resolution.
The "reps" are the number of samples the magnetometer will average before sending out a final value at the requested sampling frequency/rate.
The acceptable magnetometer sampling rates:
class MagBmm150Odr:
_10Hz = 0
_2Hz = 1
_6Hz = 2
_8Hz = 3
_15Hz = 4
_20Hz = 5
_25Hz = 6
_30Hz = 7
Take a look at our test code: https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/master/test/test_magnetometer_bmm150.py
CPP docs for reference: https://mbientlab.com/cppdocs/latest/magnetometer.html
CPP API docs for reference: https://mbientlab.com/documents/metawear/cpp/0/magnetometer__bmm150_8h.html
Example usage:
More example: