L3GD20 breakout 2000deg/sec range errors

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sanjay2877
 
Posts: 3
Joined: Wed Mar 22, 2017 2:52 pm

L3GD20 breakout 2000deg/sec range errors

Post by sanjay2877 »

Hi,
I am using the L3GD20H breakout from Adafruit on Particle Photon. In the library (Adafruit_L3GD20) on particle photon, when I set the range of the accelerometer to 500 deg/sec or 2000 deg/sec, the initialization of the board fails. The board is working perfects with range as 250 deg/sec. Do you know why?

Thanks,

Sanjay

Code: Select all

_____
void setup()
{
    delay(3000);
    
    Serial.println("Initializing Gyro L3GD20H");
    
  // Try to initialise and warn if we couldn't detect the chip
  //if (gyro.begin(gyro.L3DS20_RANGE_250DPS))
  //if (!gyro.begin(gyro.L3DS20_RANGE_500DPS))
  if (!gyro.begin(gyro.L3DS20_RANGE_2000DPS))
  {
    gyro_initialized = true;
    Serial.println("L3GD20H init complete");
  }
  else
  {
    Particle.publish("Error initializing gyro", PRIVATE);
    Serial.print("Error initializing gyro");
  }
}
Last edited by adafruit_support_mike on Fri Mar 24, 2017 3:31 am, edited 2 times in total.
Reason: added CODE tags to preserve formatting

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: L3GD20 breakout 2000deg/sec range errors

Post by adafruit_support_mike »

I'm not sure what could be causing that.

Are you using the I2C interface or the SPI interface?

User avatar
sanjay2877
 
Posts: 3
Joined: Wed Mar 22, 2017 2:52 pm

Re: L3GD20 breakout 2000deg/sec range errors

Post by sanjay2877 »

Hi,
I am using I2C interface. The adafruit module is working with range as 250 deg/sec, so I doubt its an I2C issue. I think it may have something to do with initial configuration, when the range is set to 2000 deg/sec.

Thanks,

Sanjay

User avatar
sanjay2877
 
Posts: 3
Joined: Wed Mar 22, 2017 2:52 pm

Re: L3GD20 breakout 2000deg/sec range errors

Post by sanjay2877 »

Upon investigation, looks like there is a bug in the driver code:

replace:
if (!gyro.begin(gyro.L3DS20_RANGE_2000DPS))

with:
if (gyro.begin(gyro.L3DS20_RANGE_2000DPS))

"!" should not be there for range 500 DEG/SEC and 2000 DEG/SEC. The check is correct for 250 DEG/SEC.

Sanjay

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: L3GD20 breakout 2000deg/sec range errors

Post by adafruit_support_mike »

I'll have the folks who manage that library check it out. Thank you!

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”