I need some help regarding a project I am working on nowadays. I am stuck at a number of things and want guidance regarding them. I am working on a project which is using Arduino Due (Board Model DUE R3) connected with ADXL345 accelerometer. The board is connected with Pc with a usb cable. Right now I am using the following code to recieve the x,y and z readings from the accelerometer:
Adafruit_ADXL345_Unified BSens = Adafruit_ADXL345_Unified(1);
With this code right now I am recieving the readings from the accelerometer at 310 Hz datarate. Increasing the data rate starts to give errors in the reception of the data (printing of data on the screen at once). The ADXL345 manual says that we can increase the data rate of the accelerometer to upto 3200Hz. So my plan is to increase the datarate of the accelerometer to 3200Hz(maximum value) and store it as a packet of data in the Arduino Due Board and recieve that data after every 1 or 2 seconds as a packet file.
So can you please guide me in how to increase the sampling rate of my ADXL345 Accelerometer and then how to store the data (x,y and z values) coming from accelerometer to the Arduino board for 1 or 2 seconds, in the form of packet and then how to receive that packet to Pc after every 1 or 2 seconds?
As I am new to this project so a detailed explanation will be appreciated.
Will be really grateful to people if you please help me in this project. Can also provide additional information if needed.
Thank you and have a nice day.