I'm working with an Arduino mega 2560 and ADXL345. The sampling frequency I need is 200Hz.I tried changing the baud rate and delay but in every second, the number of data collected per second deceases.
How do I program Arduino to satisfy that frequency?
We have no idea how to solve your problem because we can't see it. Please post your code using code tags. The code tags make the code look
like this
when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don't do it, some of the character sequences in the code can be misinterpreted by the forum code as italics or funny emoticons.
Unless the sketch is too large, it's better if you post your code, rather than attach it. When it's attached, we have to download it, create a folder then open your code in our IDE. And afterwards, the folder remains unless we navigate to the "Temp" folder and manually remove it. It's much easier to just view the code in your post.