Adafruit ISM330DHCX - 6 DoF IMU

Hi All,

I have built a sensor module using ISM33ODHNX and Feather 32u4. I have written a small test code to see how the module works and get the output. The following is the code:

void setup(void){
ism330dhcx.begin_I2C();
  ism330dhcx.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); //valid ranges(+-g): 2, 4, 8, 16
  ism330dhcx.setGyroRange(LSM6DS_GYRO_RANGE_500_DPS); //valid ranges(deg/s): 125, 250, 500, 1000, 2000, 4000
      
  ism330dhcx.setAccelDataRate(LSM6DS_RATE_208_HZ);
  ism330dhcx.setGyroDataRate(LSM6DS_RATE_208_HZ);
      //valid data rates (Hz): 0(SHUTDOWN), 12.5, 26, 52, 104, 208, 416, 833, 1.66K, 3.33K, 6.66K
 
  ism330dhcx.configInt1(false, false, true); // accelerometer DRDY on INT1
  ism330dhcx.configInt2(false, true, false); // gyro DRDY on INT2
}
void loop(void){
 sensors_event_t accel;
  sensors_event_t gyro;
  sensors_event_t temp;
  //get data
  ism330dhcx.getEvent(&accel, &gyro, &temp);

rishikanths:
Hi All,

I have built a sensor module using ISM33ODHNX and Feather 32u4. I have written a small test code to see how the module works and get the output. The following is the code:

void setup(void){

ism330dhcx.begin_I2C();
 ism330dhcx.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); //valid ranges(+-g): 2, 4, 8, 16
 ism330dhcx.setGyroRange(LSM6DS_GYRO_RANGE_500_DPS); //valid ranges(deg/s): 125, 250, 500, 1000, 2000, 4000
     
 ism330dhcx.setAccelDataRate(LSM6DS_RATE_208_HZ);
 ism330dhcx.setGyroDataRate(LSM6DS_RATE_208_HZ);
     //valid data rates (Hz): 0(SHUTDOWN), 12.5, 26, 52, 104, 208, 416, 833, 1.66K, 3.33K, 6.66K

ism330dhcx.configInt1(false, false, true); // accelerometer DRDY on INT1
 ism330dhcx.configInt2(false, true, false); // gyro DRDY on INT2
}
void loop(void){
sensors_event_t accel;
 sensors_event_t gyro;
 sensors_event_t temp;
 //get data
 ism330dhcx.getEvent(&accel, &gyro, &temp);

Sorry, I accidently posted unfinished post. In the loop, I print the values to the serial @ 9600 baud rate.
Now, I have a python code that reads the serial data and process it. Here are a few things I am unable to understand:

  1. No matter what frequency I set for the accel or gyro data rate, I get 203-210 data points in my python code for every second. I see the same number of data points on serial monitor also.
  2. I even tried "LSM6DS_RATE_SHUTDOWN", but I still get values written to serial

Can someone please help me understand, why that irrespective of the "data rate", I see the same number of data points.
Why does the program still generate data when I set the data rate to "LSM6DS_RATE_SHUTDOWN".

Thanks for the help.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.