I am trying to use an ADXL345 accelerometer. SparkFun has a great user guide, but it is specific for the Arduino UNO.
It is here ----> https://www.sparkfun.com/tutorials/240
The problem is that the UNO uses pins 10-13 for CS, SDA, SDO and SCL. However, the Mega2560, which I am using, uses pins 50-53.
Apparently, the SPI.h library takes care of all of the pins according to what type of Arduino you have, except for CS (chip/slave select). I have defined the CS as 53 in the sketch and changed only that in the SparkFun's beginner sketch. This theoretically should be sufficient given that SPI.h takes care of the other pins according to your Arduino type. I am getting an output of "-1" such that the device is not connected.
Please help, thanks in advance.