diff --git a/Adafruit_L3GD20.cpp b/Adafruit_L3GD20.cpp index 9a22ad2..d4ddb1a 100644 --- a/Adafruit_L3GD20.cpp +++ b/Adafruit_L3GD20.cpp @@ -1,7 +1,7 @@ /*************************************************** - This is a library for the L3GD20 GYROSCOPE + This is a library for the L3GD20 and L3GD20H GYROSCOPE - Designed specifically to work with the Adafruit L3GD20 Breakout + Designed specifically to work with the Adafruit L3GD20(H) Breakout ----> https://www.adafruit.com/products/1032 These sensors use I2C or SPI to communicate, 2 pins (I2C) @@ -50,7 +50,9 @@ bool Adafruit_L3GD20::begin(l3gd20Range_t rng, byte addr) /* Make sure we have the correct chip ID since this checks for correct address and that the IC is properly connected */ - if (read8(L3GD20_REGISTER_WHO_AM_I) != L3GD20_ID) + uint8_t id = read8(L3GD20_REGISTER_WHO_AM_I); + //Serial.println(id, HEX); + if ((id != L3GD20_ID) && (id != L3GD20H_ID)) { return false; } diff --git a/Adafruit_L3GD20.h b/Adafruit_L3GD20.h index 047165d..db982ff 100644 --- a/Adafruit_L3GD20.h +++ b/Adafruit_L3GD20.h @@ -26,7 +26,8 @@ #define L3GD20_ADDRESS (0x6B) // 1101001 #define L3GD20_POLL_TIMEOUT (100) // Maximum number of read attempts -#define L3GD20_ID (0b11010100) +#define L3GD20_ID 0xD4 +#define L3GD20H_ID 0xD7 class Adafruit_L3GD20 { diff --git a/README.md b/README.md index 42655ec..43ae252 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ This is a library for the Adafruit Triple-Axis Gyro sensor -Designed specifically to work with the Adafruit L3GD20 Breakout +Designed specifically to work with the Adafruit L3GD20/L3GD20H Breakout ----> https://www.adafruit.com/products/1032 These sensors use I2C or SPI to communicate, 2 pins (I2C) or 4 pins (SPI)