I2C Sensor Detection

I'm trying to connect my Arduino Nano to a LSM6DS33 Gyroscope and Accelerometer, and the Nano is unable to detect the sensor.

I'm using the following library:
LSM6DS33 Library: GitHub - pololu/lsm6-arduino: Pololu Arduino library for LSM6DS33 accelerometer and gyro

This is the code that determines whether the sensor was detected (LSM6.cpp):

bool LSM6::init(deviceType device, sa0State sa0)
{
// perform auto-detection unless device type and SA0 state were both specified
if (device == device_auto || sa0 == sa0_auto)
{
// check for LSM6DS33 if device is unidentified or was specified to be this type
if (device == device_auto || device == device_DS33)
{
// check SA0 high address unless SA0 was specified to be low
if (sa0 != sa0_low && testReg(DS33_SA0_HIGH_ADDRESS, WHO_AM_I) == DS33_WHO_ID)
{
sa0 = sa0_high;
if (device == device_auto) { device = device_DS33; }
}
// check SA0 low address unless SA0 was specified to be high
else if (sa0 != sa0_high && testReg(DS33_SA0_LOW_ADDRESS, WHO_AM_I) == DS33_WHO_ID)
{
sa0 = sa0_low;
if (device == device_auto) { device = device_DS33; }
}
}

// make sure device and SA0 were successfully detected; otherwise, indicate failure
if (device == device_auto || sa0 == sa0_auto)
{
return false;
}
}

_device = device;

switch (device)
{
case device_DS33:
address = (sa0 == sa0_high) ? DS33_SA0_HIGH_ADDRESS : DS33_SA0_LOW_ADDRESS;
break;
}

return true;
}

For me, it always returns False when running the example sketch in the library Serial.ino.
DS33_WHO_ID is defined to be 0x69, and for me, the WHO_AM_I register of the sensor isn't 0x69.
I'm not sure what I can do to make sure the register contains the right value for the sensor to be detected.

I've ran i2c scanner code to verify that my wiring is correct and that i2c communication is functional.
(Arduino Playground - I2cScanner)

The WHO_AM_I register is defined to be at address 0x0F. The contents of that register should equal DS33_WHO_ID which is 0x69.

That code is trying to read register 0x0F at the two addresses (HIGH and LOW). You could just do that directly and see what value you are getting.

Does the i2c scanner report the same address as the code is expecting? This code will tell you what is in the WHO_AM_I register, if it can be read.
7 bit: HIGH_ADDRESS 0x6B
7 bit: LOW_ADDRESS 0x6A

#include <Wire.h>

const byte WHO_AM_I          = 0x0F;
#define DS33_SA0_HIGH_ADDRESS 0b1101011
#define DS33_SA0_LOW_ADDRESS  0b1101010

void setup()
{
  Serial.begin(9600);
  Wire.begin();

  test(DS33_SA0_HIGH_ADDRESS);
  test(DS33_SA0_LOW_ADDRESS);
}

void loop()
{
}

void test(uint8_t address)
{
  Serial.print("Testing adddress 0x" );
  Serial.println( address, HEX );
  int result = testReg( address, WHO_AM_I );
  if ( result < 0 ) {
    Serial.print("failed to read register");
  }
  else {
    Serial.print("Register 0x0"); Serial.print(WHO_AM_I, HEX);
    Serial.print(" returned 0x"); Serial.print(result, HEX);
  }
}

int16_t testReg(uint8_t address, uint8_t reg)
{
  Wire.beginTransmission(address);
  Wire.write((uint8_t)reg);
  if (Wire.endTransmission() != 0)
  {
    return -1;
  }

  Wire.requestFrom(address, (uint8_t)1);
  if (Wire.available())
  {
    return Wire.read();
  }
  else
  {
    return -1;
  }
}