I have a Sparkfun thing plus c connected using the qwiic system to a SparkFun Qwiic 6DoF - ISM330DHCX.
I am using the following code, which suppose to output 416hz but I get the same 135hz s without using the commands:
#define ISM_XL_ODR_416Hz 6
#define ISM_GY_ODR_416Hz 6
Any suggestions? Here is the code:
/******************************************************************************
Basic_Readings.ino
https://github.com/sparkfun/SparkFun_Qwiic_6DoF_LSM6DSO
https://github.com/sparkfun/SparkFun_Qwiic_6DoF_LSM6DSO_Arduino_Library
Description:
Most basic example of use.
Example using the LSM6DSO with basic settings. This sketch collects Gyro and
Accelerometer data every second, then presents it on the serial monitor.
Development environment tested:
Arduino IDE 1.8.2
This code is released under the [MIT License](http://opensource.org/licenses/MIT).
Please review the LICENSE.md file included with this example. If you have any questions
or concerns with licensing, please contact techsupport@sparkfun.com.
Distributed as-is; no warranty is given.
******************************************************************************/
#include "SparkFunLSM6DSO.h"
#include "Wire.h"
#define ISM_XL_ODR_416Hz 6
#define ISM_GY_ODR_416Hz 6
LSM6DSO myIMU; //Default constructor is I2C, addr 0x6B
void setup() {
Serial.begin(115200);
delay(500);
Wire.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("\t");
// Serial.print(" Y = ");
Serial.print(myIMU.readFloatAccelY(), 3);
Serial.print("\t");
// Serial.print(" Z = ");
Serial.print(myIMU.readFloatAccelZ(), 3);
Serial.print("\t");
// Serial.print("\nGyroscope:\n");
// Serial.print(" X = ");
Serial.print(myIMU.readFloatGyroX(), 3);
Serial.print("\t");
// Serial.print(" Y = ");
Serial.print(myIMU.readFloatGyroY(), 3);
Serial.print("\t");
// Serial.print(" Z = ");
Serial.print(myIMU.readFloatGyroZ(), 3);
Serial.print("\t");
// Serial.print("\nThermometer:\n");
// Serial.print(" Degrees F = ");
// Serial.println(myIMU.readTempF(), 3);
//
//delay(10);
}