Shop OBEX P1 Docs P2 Docs Learn Events
MMA7455 Accelerometer Z axis reading — Parallax Forums

MMA7455 Accelerometer Z axis reading

blewis999blewis999 Posts: 1
edited 2014-12-02 00:32 in Accessories
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

  • PicAxePicAxe Posts: 4
    edited 2014-12-02 00:32
    Hi, I am using Picaxe and Basic, still trying to read the device, are you able to assist a newbie ?
Sign In or Register to comment.