I'm using this cheap ADXL chip with Arduino Uno. When I read the sensor with I2C - it works fine. However I have some servo motors as well which generate a lot of noise and when I turn the motors on, the sensor readings become pretty much useless.
I read that SPI is much more immune to noise, so I decided to go this way. However I just cannot get it to work with SPI. I'm using this code, which seems to work for other people: https://www.sparkfun.com/tutorials/240
I triple checked the wirings, they seems ok to me, tried with and without level shifter, tried hooking up various pull-up resistors... and still I get just zeroes. Yet I2C works just fine (without any pull-ups).
I'm wondering since the Sparkfun code uses a different breakout board for the ADXL chip - could it be that mine needs some specific pull-ups, that are not mentioned in that tutorial? How can I know what pull-ups need to be placed?
And any other suggestions will be much appreciated!