33 change[
CHX] = fabs(baseline[
CHX] - sample[
CHX]);
34 change[
CHY] = fabs(baseline[
CHY] - sample[
CHY]);
35 change[
CHZ] = fabs(baseline[
CHZ] - sample[
CHZ]);
36 changed = (change[
CHX]>tolerance) ||
37 (change[CHY]>tolerance) ||
38 (change[
CHZ]>tolerance);
40 baseline[
CHX] = sample[
CHX];
41 baseline[
CHY] = sample[
CHY];
42 baseline[
CHZ] = sample[
CHZ];
45 if ((*count) <= winLength) (*count) += 1;
47 return(*count > winLength);
#define CHZ
Used to access Z-channel entries in various data data structures.
#define CHY
Used to access Y-channel entries in various data data structures.
The sensor_fusion.h file implements the top level programming interface.
#define CHX
Used to access X-channel entries in various data data structures.
bool motionCheck(float sample[3], float baseline[3], float tolerance, uint32_t winLength, uint32_t *count)