Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/SparkFunLSM9DS1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Distributed as-is; no warranty is given.

LSM9DS1::LSM9DS1()
{
init(); //Initialise settings
}

void LSM9DS1::init()
Expand Down Expand Up @@ -152,8 +153,6 @@ uint16_t LSM9DS1::begin(uint8_t agAddress, uint8_t mAddress, TwoWire &wirePort)
_xgAddress = settings.device.agAddress;
_mAddress = settings.device.mAddress;

init();

constrainScales();
// Once we have the scale values, we can calculate the resolution
// of each sensor. That's what these functions are for. One for each sensor
Expand Down Expand Up @@ -198,8 +197,6 @@ uint16_t LSM9DS1::beginSPI(uint8_t ag_CS_pin, uint8_t m_CS_pin)
_xgAddress = settings.device.agAddress;
_mAddress = settings.device.mAddress;

init();

constrainScales();
// Once we have the scale values, we can calculate the resolution
// of each sensor. That's what these functions are for. One for each sensor
Expand Down
5 changes: 2 additions & 3 deletions src/SparkFunLSM9DS1.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ class LSM9DS1
// If IMU_MODE_SPI, this is the cs pin of the magnetometer (CS_M)
LSM9DS1();

// begin() and beginSPI() -- Initialize the gyro, accelerometer, and magnetometer.
// This will set up the scale and output rate of each sensor. The values set
// in the IMUSettings struct will take effect after calling this function.
// begin() and beginSPI() -- The values set in the IMUSettings struct will take
// effect after calling this function.
// INPUTS:
// - agAddress - Sets either the I2C address of the accel/gyro or SPI chip
// select pin connected to the CS_XG pin.
Expand Down