Open IanBUK opened 11 months ago
Update to PR, to:
1) Fix bug in OutputConfig
that showed the _i2cAddressFxos8700
rather than the _i2cAddressMPL3115
.
2) Add an additional override for begin:
bool NXPMotionSense::begin(const uint8_t i2cAddressFxos8700, const uint8_t i2cAddressFxas21002)
This allows the class consumer to omit the MPL3115 address. When this is called, the MPL3115's active flag is set to false and so it is never read.
This change allows the consumer to specify the i2c addresses for the FXOS8700, FXAS21002 and MPL3115. It also allows the consumer of the library to specify whether the MPL3115, the temperature/pressure sensor is enabled or disabled.
The new public functions are:
The first two provide overrides to the existing
begin
function, one to provide the addresses and a second that also allows specifying whether to use the MPL3115.These values are stored private class level variables:
The examples have been updated to show the new overrides, with my sensors. This is because the i2c addresses on my boards are at non-default addresses, and they don't have an MPL3115. This means I call the
begin
with: