Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 4180_FINAL_PROJECT 4180_FINAL_PROJECTUricascode 4180_FINAL_PROJECTUWv3
Revision 3:487783d19cc4, committed 2018-11-19
- Comitter:
- cbrice6
- Date:
- Mon Nov 19 18:41:07 2018 +0000
- Parent:
- 2:36abf8e18ade
- Commit message:
- Commented out "pc" debugging.
Changed in this revision
| LSM9DS1.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/LSM9DS1.cpp Wed Feb 03 18:45:40 2016 +0000
+++ b/LSM9DS1.cpp Mon Nov 19 18:41:07 2018 +0000
@@ -36,7 +36,7 @@
#define LSM9DS1_COMMUNICATION_TIMEOUT 1000
float magSensitivity[4] = {0.00014, 0.00029, 0.00043, 0.00058};
-extern Serial pc;
+//extern Serial pc;
LSM9DS1::LSM9DS1(PinName sda, PinName scl, uint8_t xgAddr, uint8_t mAddr)
:i2c(sda, scl)
@@ -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);