As far as I have understood from your solution, I have configured the BMI160 accelerometer of the XDK for my purpose which has a bandwidth of 1600Hz. Now, to read the data, I am creating a task; the task calls a function which goes trough an infinite while loop and and keeps storing the accelerometer data. I keeps this task alive for 1 minute using vTaskDelay(60000) and then I suspend this task. With this, I achieve, quite a high speed for sure. But now, after one minute, its storing different number of datas. For example, Once I got 146701 samples after one minute, i.e around 2445 samples/second the other time I got 150940 samples, i.e. 2515 samples/second. I have to stabilize it to a fixed rate. Can you give a solution to that? I am attaching the code I am using for this to read the accelerometer data. Also I am attaching screenshot of the data that I stored in the csv files for 2 different times. Thank you. while(1) { Retcode_T returnValue = RETCODE_FAILURE; char acelBuffer[100] = { 0 }; Accelerometer_XyzData_T bmi160 = {INT32_C(0), INT32_C(0), INT32_C(0)}; memset(&bmi160, 0, sizeof(CalibratedAccel_XyzMps2Data_T)); returnValue = Accelerometer_readXyzGValue(xdkAccelerometers_BMI160_Handle,&bmi160); long int valueAccl=(long int) bmi160.zAxisData; if (RETCODE_OK == returnValue) { memset(&acelBuffer, 0x00, sizeof(acelBuffer)); sprintf(acelBuffer, "%ld\n", valueAccl); writeDataIntoFileOnSdCard(acelBuffer); }
... View more