2019-01-31 02:48 AM
This example describes how to set up a finite state machine to enable the built-in detection of a Motion action. The picture here below shows the steps of the dedicated FSM. Motion FSM allows you to detect the movement of your device from a steady state to a moving state.
Input data are the axl output stream (select ODR >= 26Hz)
Mask selects as interesting orientation axis the overall resultant in positive direction v+ (0x02)
Thresholds is set to 1.1g (of the 1g gravity)
Timeout selectable (e.g. 0x7D = 5 s)
Output is an interrupt when the device is moving, while it doesn’t generate other interrupt until the device is still for 5 s
Enjoy!