If i drop my phone can i calculate the speed of the fall until my phone hits the ground? With the motion sensor type_acclerometer
I once read thisWhat do you care? Then it will be broken!
I once read this
You need to integrate acceleration to get the velocity.
There are a number of ways of doing this numerically.
I assume that you get these readings regularly with a spacing of δt, for example δt=100ms or something like that.
About the simplest way to do it is
Where v(t) is the velocity at time t. but there are more sophisticated ways of doing it.
The problem is complicated by velocity being three dimensional - so you need to integrate in each of the three dimensions x, y and z separated. It depends how the phone gives you the information about the acceleration, but if you get ax, ay and azat regular intervals then you can do the following.
vx += ax * dt;
vy += ay * dt;
vz += az * dt;
If you get accleration as a raw number and angle then you will have to convert from I guess polar coordinates to xyz components to be able to add them up.
Total speed, |v| is, of course, given by |v|=√vx+vy+vz.
He is write. You should check the accelerometers. Usually one of them shows the inertial acceleration ( 1g which is 9.8 m/sec^2), the others show about 0, or a mix according to the phone position.Try to detect the accelerometer.
A choc will give much higher values than the shaking.
You'll need a few tests to determine the optimum threshold.
You have got it wrong...so what i need to check is calculate sqrt(x^2+y^2+z^2) of all axis that will give me about 0 when there was no shake and after a hit on the ground i need to ask for the last z value if it was 9.8 like this i can know that there was a free fall before the hit and start the alarm
i dont know but maybe you should get any values cause the phone already work.let say old person
it must not be only on a heart attack, it could be whyle riding a bike, jogging..i dont know but maybe you should get any values cause the phone already work.
But maybe the "speed" can be irritating as it can be "slow" in some situations. starting hurting in breast (heart)... The person starting to bend down and in the last instance he then fell down. It is not a long way. and the speed may be really slow.
PS: I´ve already had multiple strokes as yet (5)