I have a LSM6DS3 sensor wired to a Wemos d1 mini microcontroller and am using Arduino code to get acceleration and gyroscope data from the sensor to display to the serial monitor. I am getting some values to display, but they make no sense and are not changing with sensor orientation or motion. Anyone have any idea as to why? I have attached pics of the sensor set up and serial monitor output and the code I'm using is below.
#include "SparkFunLSM6DS3.h"
#include "Wire.h"
#include "SPI.h"
LSM6DS3 myIMU; //Default constructor is I2C, addr 0x6B
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
delay(1000); //relax...
Serial.println("Processor came out of reset.\n");
//Call .begin() to configure the IMU
myIMU.begin();
}
void loop()
{
//Get all parameters
Serial.print("\nAccelerometer:\n");
Serial.print(" X = ");
Serial.println(myIMU.readFloatAccelX(), 4);
Serial.print(" Y = ");
Serial.println(myIMU.readFloatAccelY(), 4);
Serial.print(" Z = ");
Serial.println(myIMU.readFloatAccelZ(), 4);
Serial.print("\nGyroscope:\n");
Serial.print(" X = ");
Serial.println(myIMU.readFloatGyroX(), 4);
Serial.print(" Y = ");
Serial.println(myIMU.readFloatGyroY(), 4);
Serial.print(" Z = ");
Serial.println(myIMU.readFloatGyroZ(), 4);
Serial.print("\nThermometer:\n");
Serial.print(" Degrees C = ");
Serial.println(myIMU.readTempC(), 4);
Serial.print(" Degrees F = ");
Serial.println(myIMU.readTempF(), 4);
delay(1000);
}