user45264: I have an ADXL345 accelerometer and I read it with an arduino through I2C. I want to get readings at a frequency higher than 500Hz. According to the documentation this should be easily achievable, however I've downloaded and used multiple libraries and none of them was able to achieve a sampling rate higher than 100Hz. They were all based on the arduino Wire library which doesn't seen very efficient. Could someone point me to a library or give me pieces of code that will allow me to sample data at 500+Hz? I send the data to matlab, not that it probably matters.

user42539: If you want highest possible frequency, I'd use SPI instead.
With 16 MHz Arduino, SPI clock can be 4MHz.
The chip only supports I2C at 400 KHz clock, which is way slower.
http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf

45264: <p>I have an ADXL345 accelerometer and I read it with an arduino through I2C. I want to get readings at a frequency higher than 500Hz. According to the documentation this should be easily achievable, however I've downloaded and used multiple libraries and none of them was able to achieve a sampling rate higher than 100Hz. They were all based on the arduino Wire library which doesn't seen very efficient. Could someone point me to a library or give me pieces of code that will allow me to sample data at 500+Hz? I send the data to matlab, not that it probably matters.</p>
 42539: <p>If you want highest possible frequency, I'd use SPI instead.
With 16 MHz Arduino, SPI clock can be 4MHz.</p>

<p>The chip only supports I2C at 400 KHz clock, which is way slower.
<a href="http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf" rel="nofollow noreferrer">http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf</a></p>
