Accelerometer Data

The accelerometer measures acceleration on a range from -2g to +2g on each of the X, Y, Z axis.

The accelerometer values are encoded as two's complement, because they contain signed values.

Accelerometer itself outputs values in range (-2g,2g) for each axis, those values are divided by 16

to fit into range (-127,127) and into single byte of data.

For example, when original value is 0xC0, it is interpreted as -64, which when multiplied by 16 yields

value of -1024mg. Negative values are those larger than 0x7F (127).

The easiest way to convert such value is either to use specific language library to parse string as signed char

or to invert all bits and add 1.

Example data:

X Axis:

Raw data: "013020410002" Interpretation: X:1040 Y:0 Z:32

Y Axis:

Raw data: "01302003c3fe" Interpretation: X:48 Y:-976 Z:-16

Z Axis:

Raw data: "0130200400c0" Interpretation: X:64 Y:0 Z:-1024

Last updated