Skip to content

Commit 8dcbe6d

Browse files
authored
Merge pull request #34 from Rocketct/master
Added compatibility with other Arduino IMU libraries
2 parents 5ab6cab + 5664175 commit 8dcbe6d

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Arduino_LSM6DS3.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20-
#ifndef _ARUDINO_LSM6DS3_H_
21-
#define _ARUDINO_LSM6DS3_H_
20+
#ifndef _ARDUINO_LSM6DS3_H_
21+
#define _ARDUINO_LSM6DS3_H_
2222

2323
#include "LSM6DS3.h"
2424

src/LSM6DS3.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ int LSM6DS3Class::writeRegister(uint8_t address, uint8_t value)
209209
}
210210

211211
#ifdef ARDUINO_AVR_UNO_WIFI_REV2
212-
LSM6DS3Class IMU(SPI, SPIIMU_SS, SPIIMU_INT);
212+
LSM6DS3Class IMU(SPI, SPIIMU_SS, SPIIMU_INT);
213213
#else
214-
LSM6DS3Class IMU(Wire, LSM6DS3_ADDRESS);
215-
#endif
214+
LSM6DS3Class IMU_LSM6DS3(Wire, LSM6DS3_ADDRESS);
215+
#endif

src/LSM6DS3.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,6 @@ class LSM6DS3Class {
8585
SPISettings _spiSettings;
8686
};
8787

88-
extern LSM6DS3Class IMU;
88+
extern LSM6DS3Class IMU_LSM6DS3;
89+
#undef IMU
90+
#define IMU IMU_LSM6DS3

0 commit comments

Comments
 (0)