wafa_ath
DIIDevHeads IoT Integration Server
•Created by aymen ammari on 7/23/2024 in #firmware-and-baremetal
Isolating X-Axis Readings from Accelerometer Interference
A low pass filter smooths out rapid changes in data, so that will make x axis reading more stable U can using a formula: filteredValue = α * newReading + (1 - α) * oldFilteredValue
Where α (alpha) controls smoothing: lower α = more smoothing
U can add this code
const float alpha = 0.2;
float filteredX = 0;
// In loop:
filteredX = alpha * newX + (1 - alpha) * filteredX;
Adjust alpha (0.05 to 0.5) to balance between smoothness and responsiveness.
Try this and give me ur feedback
9 replies