SparkFun_LSM9DS1_Arduino_Library icon indicating copy to clipboard operation
SparkFun_LSM9DS1_Arduino_Library copied to clipboard

Initialising IMU overwrites settings

Open nuhash opened this issue 5 years ago • 1 comments

When calling LSM9DS1::begin(...), it calls LSM9DS1::init() which overrides any user defined settings https://github.com/sparkfun/SparkFun_LSM9DS1_Arduino_Library/blob/7269199c7a38a70becf454148474c6f05028e5b7/src/SparkFunLSM9DS1.cpp#L155

Perhaps call LSM9DS1::init() within the constructor instead to set default values for the settings. Users can then change them as necessary prior to calling LSM9DS1::begin().

nuhash avatar Dec 29 '19 20:12 nuhash

The funny thing here is that pretty much every example for this library that I found configures settings and then calls begin(..). All of these examples are broken and use default settings.

I think the solution proposed by @nuhash is the right way to go.

choller avatar Dec 15 '20 10:12 choller