Hi!
i recently got a LSM6DSO IMU.
im trying to get the example code (see code below) from sparkfun to work but im having problems with reading the sensor.
the sensor output doesn't seem to change when moving the senor. also i don't think it is 304F inside ![]()
the only change i have made is Wire.begin() to Wire1.begin() to use the QWIIC port. without it i get no output at all
Thanks for any help.
Serial monitor:
11:34:54.222 -> Accelerometer:
11:34:54.222 -> X = 7.913
11:34:54.222 -> Y = 7.913
11:34:54.222 -> Z = 7.913
11:34:54.222 -> Gyroscope:
11:34:54.222 -> X = 141.881
11:34:54.222 -> Y = 141.881
11:34:54.222 -> Z = 141.881
11:34:54.222 -> Thermometer:
11:34:54.222 -> Degrees F = 304.967
#include "SparkFunLSM6DSO.h"
#include "Wire.h"
//#include "SPI.h"
LSM6DSO myIMU; //Default constructor is I2C, addr 0x6B
void setup() {
Serial.begin(115200);
delay(500);
Wire1.begin();
myIMU.begin();
delay(10);
if( myIMU.begin() )
Serial.println("Ready.");
else {
Serial.println("Could not connect to IMU.");
Serial.println("Freezing");
}
if( myIMU.initialize(BASIC_SETTINGS) )
Serial.println("Loaded Settings.");
}
void loop()
{
//Get all parameters
Serial.print("\nAccelerometer:\n");
Serial.print(" X = ");
Serial.println(myIMU.readFloatAccelX(), 3);
Serial.print(" Y = ");
Serial.println(myIMU.readFloatAccelY(), 3);
Serial.print(" Z = ");
Serial.println(myIMU.readFloatAccelZ(), 3);
Serial.print("\nGyroscope:\n");
Serial.print(" X = ");
Serial.println(myIMU.readFloatGyroX(), 3);
Serial.print(" Y = ");
Serial.println(myIMU.readFloatGyroY(), 3);
Serial.print(" Z = ");
Serial.println(myIMU.readFloatGyroZ(), 3);
Serial.print("\nThermometer:\n");
Serial.print(" Degrees F = ");
Serial.println(myIMU.readTempF(), 3);
delay(1000);
}
