7 years ago.

how to detect freefall in frdm-kl25z

does anyone know how to detect freefall in kl25z. i am using value <0.2 for all three axis to detect freefall and than blink the led. but as soon as i run the code, the led starts blinking.

kindly let me know if someone has a solution.

By all 3 axis do you mean individually or combined?

If individually are you using if(value < 0.2) or if (fabs(value) < 0.2)? Depending on orientation you could get -1 when sitting still.

If combined then this isn't an issue, it should be as simple as if ((x*x+y*y+z*z) < 0.04), (0.04 = 0.2 squared, it saves a square root operation)

posted by Andy A 23 May 2018

1 Answer

6 years, 6 months ago.

Can i see your code?