MPU-9250_Breakout icon indicating copy to clipboard operation
MPU-9250_Breakout copied to clipboard

Adding support for setting sensor scales

Open nalauder opened this issue 6 years ago • 3 comments

In the current implementation, it seems that the only way to change the scale of the sensors is to either directly modify the library or to create a child class of the library class.

I believe an easier solution to this is to add some simple methods that take the desired scale as arguments and set them as necessary.

These proposed changes ensure only valid scales can be written to each of the three sensors. They also achieve both writing the new scales to the device, and setting the scale value within the library itself.

nalauder avatar May 19 '18 04:05 nalauder

Looks pretty good. But how did AK8963_ADDRESS get in there?

nseidle avatar May 19 '18 14:05 nseidle

Was taken from the initAK8963 function. In order to write the new scale to the magnetometer

nalauder avatar May 19 '18 14:05 nalauder

Sorry - I should have looked at the source. I didn't realize there was an AK8963 in there for the mag.

nseidle avatar May 19 '18 14:05 nseidle