Skip to content

57: Accelerometer Data โ€‹

๐Ÿงช Alpha

API is still evolving and may gain additional fields in future firmware versions.

Accelerometer metrics captured over time + events. Most values are time based (averages, highest value since X) or threshold based (highest value since the last one) - you can use the SET method to reset thresholds & baselines. Values are generated on-device from FIFO samples and include tilt and g-vector summaries. Everything is in 0.1g or degrees for clarity: whilst higher precision data is available, the accuracy can only really be trusted up to 0.1g or 1deg increments, and this keeps the payload size down. **Partial messages:** When only one or more of the per-axis maximum G component fields (keys 9/10/11) change and all other fields are unchanged, the device emits two messages back-to-back. First, a sparse MT_ACCEL_DATA message containing only the changed component field(s) at Q_ChangesOnly level, allowing subscribers to react immediately to axis-level changes. Second, a full MT_ACCEL_DATA message (all fields) at Q_Valid level. In all other cases only one full message is emitted, at Q_ChangesOnly if any field changed or Q_Valid if the store is unchanged.

Payload โ€‹

FieldNameDescriptionTypeUnit
1VersionPayload version / flags. Currently 0.uint8
2Latest TiltLatest tilt angles as signed int8 [x, y, z] in degrees.bytes
3Baseline TiltBaseline tilt angles as signed int8 [x, y, z] in degrees.bytes
4Maximum TiltTilt angles as signed int8 [x, y, z] at the maximum observed tilt delta from baseline.bytes
5Maximum Tilt TimeUnix timestamp for the maximum tilt event.uint32s since epoch
6Average G VectorAverage vector as signed int8 [x, y, z, magnitude] in 0.1g units.bytes
7Maximum G VectorMaximum magnitude vector as signed int8 [x, y, z, magnitude] in 0.1g units.bytes
8Maximum G TimeUnix timestamp for the maximum g event.uint32s since epoch
9Maximum G Component XPer-axis absolute maximum on X in 0.1g units.int8
10Maximum G Component YPer-axis absolute maximum on Y in 0.1g units.int8
11Maximum G Component ZPer-axis absolute maximum on Z in 0.1g units.int8
12VarianceVariance indicator derived from the running standard deviation magnitude, clamped to 0..255 mg.uint8mg

Code โ€‹

For convenience, the following constants can be used to reference this message type.