Trouble reading LSM6DS3 Accelerometer Data

Hi everyone, I’m having trouble reading accelerometer data from a LSM6DS3 IMU.

The LSM6DS3 is connected to a Pro Mini 328P (5V, 16MHz) via an FTDI USB board.

I have been using this equipment successfully for a few years now. The problem now is that additional backup units are not reading the accelerometer data correctly: when I upload my sketch, all axis read “13.25” in the serial monitor of the Arduino application on my MacBook Pro.

Hypotheses I have ruled out:

  1. Board, Processor and Port settings in the Arduion application. Code uploads successfully. I’m afraid to try uploading to the working board because I need to have at least one working unit.

  2. All hardware. I have successfully tested each component with the one working Pro Mini. The non-working Pro Minis do send correct digital data, so I know that all Pro Minis and all LSM6DS3s are not broken.

  3. Serial speed. The digital pins do read correctly on all Pro Minis.

  4. Hardware/software incompatibility due to changes in the header files. Header file has a date of 2015, which was about the time I bought the hardware.

Here is the code I’m using:

#include "SparkFunLSM6DS3.h"
#include "Wire.h"
#include "SPI.h"

LSM6DS3 myIMU; //Default constructor is I2C, addr 0x6B
int x = 0;    

void setup() {
  // put your setup code here, to run once:
  delay(1000); //relax...
  Serial.println("Processor came out of reset.\n");
  for (int pin=2; pin<7; pin++) { pinMode(pin,INPUT_PULLUP); }
  //Call .begin() to configure the IMU

void loop()

for (int pin= 2; pin<=6; pin++){     // Read and send digital pins 2-6
    x = digitalRead(pin);
    sendInt ( (x - 1) * -1 );


//Get IMU parameters (accelerometer & gyroscope)

//  sendFloat(myIMU.readFloatGyroX());
//  sendFloat(myIMU.readFloatGyroY());
//  sendFloat(myIMU.readFloatGyroZ());


void sendInt (int x){              // function to send the pin value followed by a "space". 
 Serial.print( " " ); 
void sendFloat (float x){              // function to send the pin value followed by a "space". 
 Serial.print( " " ); 

I’m completely baffled at this point. Can someone offer any additional suggestions? Thanks so much.

Please post a link to the exact LSM6DS3 module you are using, a link to where you downloaded the library and a wiring diagram (not Fritzing, hand drawn is much better).