Help please.

I just bought an Arduino Due and a few MMA 8541 3-axis accelerometers.

I followed this Adafruit tutorial on how to connect and set up the sensor. I downloaded all the libraries, flashed the MMA8541 Demo code. All worked fine.

Then when I started getting my first readings, they looked like junk. See below.

The X value is stuck at -1, and Y and Z just fluctuate wildly between -7XXX and +7XXX. It looks to me like the readings are not being interpreted with the proper number of bits or something.

Since I read about this failure mode (https://community.nxp.com/thread/478447), I tried switching to another MMA8541 board, but the exact same results happened.

What's going on ?

Help

- Code: Select all | TOGGLE FULL SIZE
`###Monitor output ####`

Adafruit MMA8451 test!

MMA8451 found!

Range = 2G

X: 63 Y: -7106 Z: -5616

X: 2.45 Y: -19.46 Z: 18.43 m/s^2

Portrait Up Front

X: -1 Y: -8130 Z: -7664

X: 2.45 Y: -17.01 Z: -12.22 m/s^2

Portrait Up Front

X: -1 Y: 5694 Z: -7152

X: 2.45 Y: -17.01 Z: -14.67 m/s^2

Portrait Up Front

X: -1 Y: 6206 Z: -8176

X: 1.53 Y: -19.46 Z: -15.90 m/s^2

Portrait Up Front

X: -1 Y: 5694 Z: -6128

X: 2.45 Y: 17.31 Z: -10.99 m/s^2

Portrait Up Front

X: -1 Y: 7230 Z: -4592

X: 2.45 Y: 14.86 Z: 17.20 m/s^2

Portrait Up Front

X: -1 Y: 5182 Z: -7664

X: 1.53 Y: -15.79 Z: -8.54 m/s^2

Portrait Up Front

X: -1 Y: 6206 Z: -6640

X: 2.45 Y: 9.96 Z: -14.67 m/s^2

Portrait Up Front

X: -1 Y: 7742 Z: 1040

X: 2.45 Y: 14.86 Z: -17.12 m/s^2

Portrait Up Front

X: -1 Y: 5182 Z: 7183

X: 0.15 Y: 16.08 Z: -6.09 m/s^2

#####