I'm working on a project using an Aduino Uno, Adafruit Data Logger Shield, Adafruit Prototype Shield, and Adafruit 9-DOF Absolute Orientation IMU (BNO055). I'm having issues understanding/adjusting the frequency at which data is being collected and recorded.
Just for some background info, my device reads quaternion values, converts them to Euler angles, and saves this data to an SD card.
Looking at this page on the Adafruit website for the BNO055, Quaternion and Euler data should be output at a frequency of 100 Hz or 0.01 seconds; the datasheet also supports this.
Is my understanding that within my sketch for my device the following line should control the delay between collected samples of data:
// set delay between data
#define BNO055_SAMPLERATE_DELAY_MS (100)
With that line set to 100 ms, my delay between output data should effectively be 10 Hz.
Am I understanding correctly that the BNO055 is reading and outputting data at a frequency of 100 Hz, but because I have my sample rate set to 10 Hz, I am actually saving the data to my SD card at a frequency of 10 Hz?
I have the data saved from my data logger shield being imported to a MATLAB program I made. Within my MATLAB program, I split the time from the text file. Looking at the time array (with the sample rate set in the sketch to 100 ms), the average difference between consecutive logged time values is 0.1351 seconds which is effectively 7.4 Hz.
Is there anyway to get the logging frequency closer to the 10 Hz that I believe it is set to? I can post more code if needed.