Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Commit

Permalink
add L3GD20H support
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Oct 1, 2014
1 parent 72bb2d2 commit 275369f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Adafruit_L3GD20.cpp
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion Adafruit_L3GD20.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 275369f

Please sign in to comment.