2019-01-28 11:08 PM
This example describes how to set up a Finite State Machine to enable the built-in detection of e.g. the orientation of a phone screen (4D orientation). The picture here below shows the steps of the dedicated FSM. Basically, to get FSM output data you have to define input data and parameters such as a mask (to select the axis and direction to be monitored for the interrupt detection), thresholds and timeout frame to manage the latency. Finally, in attachment you can find an algorithm example for the upload in Unico.
Input data are the axl output stream (select ODR >= 26Hz)
Mask selects as interesting orientation axis x+, x-, y+ and y- (0xF0)
Thresholds can be set to 0.8g both for x and for y (high threshold), and 0.2g for x and y (low threshold)
Timeout selectable (e.g. 0x0D = 520 ms)
Output is the OUTS register content for orientation (portrait up, portrait down, landscape left, landscape right)
Enjoy!