2019-02-06 08:37 AM
This example describes how to set up a finite state machine to enable the built-in detection of a basic PEDOMETER. The picture here below shows the first part of the dedicated FSM code (tomorrow the second and last part will be published). A human step pattern is composed from a first step, than a debounce phase and finally another step phase. The purpose of this part code is to detect the first step and the debounce phase steps. Note that thresholds and timers are finely tuned. In attachment you can find the state machine code to upload on your Unico tool.
Input data are the axl output stream (select ODR >= 26Hz)
Masks selects as interesting orientation the overall resultant v+ (MASK_C=0x02),
Thresholds are set to 1.1g (TH1) and 1.2g (TH2)
Timeout have been selected and tuned as 3sec (short counter, TI3) and 0xFFFF (long counter, T4)
Output of this section of the code is when a step and a debounce phase steps are detected
Enjoy!