MMA7455 Accelerometer Z axis reading
blewis999
Posts: 1
The mma7455 has three axis and outputs its data in 2's complement. But the Z axis is calibrated to 0x40 or 1g. What would be the way to calculate the signed integer of the value once the calibration is complete. Would we subract 0x40 from the reading and if it was less than 0x80 the reading would be positive, and if greater than 0x80 it would be negitive (leading bit in 8 bit mode being the sign indicator)? But this seems to squew the result in the negitive direction. What I am unsure of is the range, I can't see from the spec what the full range would be once the offset is subtracted. Normally on the x and y axis the reading (0x80 - FF) is complemented and +1 added, and the result marked as negitive or read directly if 0x00 - 0x7F. This does not seem to fit for the Z axis. Can anyone suggest an alogorithm please? Thanks
Comments