what sampleing rate are you getting at the moment?
what board are you using?
you are probably limited by the speed writing to the SD card
what do you want to do with the data?
using the very low serial baud rate of 1 character printed per millisecond: Serial.begin(9600);
Opening the SD file, writing a bit of data, and closing it again. This is EXTREMELY slow, so open the file once in setup() and close it when you are all done collecting data.
Have you checked the default sample rate used by the sensor library?
I am using Arduino uno and currently i am getting 25 to 27 samples per second..... From the acceleration data of the three axes i am applying double integration formula to get displacement thats all.....
a recent project sampled a LSM9DS1 accelerometer every 20mSeconds for transmission over BLE to an Android phone.
18 bytes/sample using double buffering filling one 1000byte buffer when transmiiting the other over BLE.
In this case the BLE transmission was the limiting factor.
I am really weak in coding...Can u please explain me clearly if i write the file open statement in setup section then where do i need to close it (In setup section or in loop section)...