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.
Diff: LSM9DS1.cpp
- Revision:
- 4:681443188833
- Parent:
- 1:87d535bf8c53
diff -r fd549671e512 -r 681443188833 LSM9DS1.cpp
--- a/LSM9DS1.cpp Sun Mar 13 21:40:10 2016 +0000
+++ b/LSM9DS1.cpp Mon Jan 27 10:47:24 2020 +0000
@@ -41,8 +41,9 @@
LSM9DS1::LSM9DS1(PinName sda, PinName scl, uint8_t xgAddr, uint8_t mAddr)
:i2c(sda, scl)
{
- init(IMU_MODE_I2C, xgAddr, mAddr); // dont know about 0xD6 or 0x3B
-}
+I2C i2c(PB_9, PB_8);
+init(IMU_MODE_I2C, xgAddr, mAddr);} // dont know about 0xD6 or 0x3B
+
/*
LSM9DS1::LSM9DS1()
{
@@ -55,6 +56,7 @@
}
*/
+
void LSM9DS1::init(interface_mode interface, uint8_t xgAddr, uint8_t mAddr)
{
settings.device.commInterface = interface;
@@ -170,7 +172,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))
@@ -1195,3 +1197,5 @@
}
return count;
}
+
+