SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By HJU
#168617
Hi,

I recently purchased a new ADXL 345 breakout board. I followed the quickstart guide to hook up the accelerometer with Arduino Mega ADK and Arduino Uno.

However, I dont get a reading in any case. The Mega reads 0,0,0 while the UNO reads -1,-1,-1. I checked the address of different registries in the code and they do seem to match with the datasheet values so i am assuming there is nothing wrong with the code.

Here is the quickstart guide: https://www.sparkfun.com/tutorials/240

Any help will be much appreciated.
By Mee_n_Mac
#168648
The MEGA ADK has it's SPI interface on different pin numbers from the Uno.

http://arduino.cc/en/Main/ArduinoBoardADK#.UwVMsoWmWVI
SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication using the SPI library. The SPI pins are also broken out on the ICSP header, which is physically compatible with the Uno, Duemilanove and Diecimila.

I also question the wisdom of using a 5v Uno with a 3.3v ADXL345, given the ratings in Table2 of the datasheet.
https://www.sparkfun.com/datasheets/Sen ... DXL345.pdf
Digital Pins : −0.3 V to VDD I/O + 0.3 V or 3.6 V, whichever is less

I'd have put a level shifter btw the two or used I2C w/pullups to 3.3v.