59 change[
CHX] = fabs(baseline[
CHX] - sample[
CHX]);
60 change[
CHY] = fabs(baseline[
CHY] - sample[
CHY]);
61 change[
CHZ] = fabs(baseline[
CHZ] - sample[
CHZ]);
62 changed = (change[
CHX]>tolerance) ||
63 (change[CHY]>tolerance) ||
64 (change[
CHZ]>tolerance);
66 baseline[
CHX] = sample[
CHX];
67 baseline[
CHY] = sample[
CHY];
68 baseline[
CHZ] = sample[
CHZ];
71 if ((*count) <= winLength) (*count) += 1;
73 return(*count > winLength);
#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 CHZ
Used to access Z-channel entries in various data data structures.
#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)