This repository provides algorithms and data structures for a pedometer based on ADXL345 by Analog Devices, Inc.. It utilizes accelerometer data and angle information to compute step counts and body movements during walking.
x
: Angle information for forward and backward body swingy
: Angle information for left and right body swingz
: Angle information for spinning motion during walking
Generates simulated accelerometer data and converts it into angle information.
Filters out noisy data by applying a mean filter to the raw data, reducing unnecessary fluctuations.
Determines the primary swing axis by calculating the variance of angle data across the three dimensions.
Calculates thresholds to classify data into high and low-level movements.
Computes the number of steps taken based on thresholds and swing periods.
Contains the sequential invocation of all algorithms in the library, generating and analyzing simulated angle data.
- Import the Walking Analytics Library into your project.
- Use the
logic
function with accelerometer data to retrieve step counts and swing patterns.
- No external dependencies required.
To compile the program, use the following command:
gcc main.c -o pedometer -lm
./pedometer