Shouldn't really be different at all from LSM9DS1_Library_cal. no print statements
Revision 4:827b3941bf5d, committed 2021-04-29
- Comitter:
- wminix3
- Date:
- Thu Apr 29 05:37:17 2021 +0000
- Parent:
- 3:89c315a713f7
- Commit message:
- no print statements;
Changed in this revision
| LSM9DS1.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/LSM9DS1.cpp Fri Apr 23 04:33:31 2021 +0000
+++ b/LSM9DS1.cpp Thu Apr 29 05:37:17 2021 +0000
@@ -169,7 +169,7 @@
// each device. Store those in a variable so we can return them.
uint8_t mTest = mReadByte(WHO_AM_I_M); // Read the gyro WHO_AM_I
uint8_t xgTest = xgReadByte(WHO_AM_I_XG); // Read the accel/mag WHO_AM_I
- pc.printf("%x, %x, %x, %x\n\r", mTest, xgTest, _xgAddress, _mAddress);
+ //pc.printf("%x, %x, %x, %x\n\r", mTest, xgTest, _xgAddress, _mAddress);
uint16_t whoAmICombined = (xgTest << 8) | mTest;
if (whoAmICombined != ((WHO_AM_I_AG_RSP << 8) | WHO_AM_I_M_RSP))
@@ -331,7 +331,7 @@
int ii;
int32_t aBiasRawTemp[3] = {0, 0, 0};
int32_t gBiasRawTemp[3] = {0, 0, 0};
- pc.printf("\n\rPlace IMU on level surface and do not move it for gyro and accel calibration.\n\r");
+ //pc.printf("\n\rPlace IMU on level surface and do not move it for gyro and accel calibration.\n\r");
wait(1);
// Turn on FIFO and set threshold to 32 samples
enableFIFO(true);
@@ -368,7 +368,7 @@
int i, j;
int16_t magMin[3] = {0, 0, 0};
int16_t magMax[3] = {0, 0, 0}; // The road warrior
- pc.printf("\n\n\r Rotate IMU device at least 360 in horizontal plane for magnetometer calibration\n\r");
+ //pc.printf("\n\n\r Rotate IMU device at least 360 in horizontal plane for magnetometer calibration\n\r");
wait(0.5);
for (i=0; i<1000; i++) {
while (!magAvailable(ALL_AXIS));
@@ -385,11 +385,11 @@
for (j = 0; j < 3; j++) {
mBiasRaw[j] = (magMax[j] + magMin[j]) / 2;
mBias[j] = calcMag(mBiasRaw[j]);
- pc.printf("%f ",mBias[j]);
+ //pc.printf("%f ",mBias[j]);
if (loadIn)
magOffset(j, mBiasRaw[j]);
}
- pc.printf("\n\rMAG calibration done\n\r");
+ //pc.printf("\n\rMAG calibration done\n\r");
}
void LSM9DS1::magOffset(uint8_t axis, int16_t offset)
{
@@ -961,7 +961,7 @@
// Whether we're using I2C or SPI, write a byte using the
// gyro-specific I2C address or SPI CS pin.
if (settings.device.commInterface == IMU_MODE_I2C) {
- pc.printf("yo");
+ //pc.printf("yo");
I2CwriteByte(_xgAddress, subAddress, data);
} else if (settings.device.commInterface == IMU_MODE_SPI) {
SPIwriteByte(_xgAddress, subAddress, data);
@@ -973,7 +973,7 @@
// Whether we're using I2C or SPI, write a byte using the
// accelerometer-specific I2C address or SPI CS pin.
if (settings.device.commInterface == IMU_MODE_I2C) {
- pc.printf("mo");
+ //pc.printf("mo");
return I2CwriteByte(_mAddress, subAddress, data);
} else if (settings.device.commInterface == IMU_MODE_SPI)
return SPIwriteByte(_mAddress, subAddress, data);