I once read thisWhat do you care? Then it will be broken!
PMSL
I once read this
You need to integrate acceleration to get the velocity.
v(t)=∫tt=0a.dt
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
v(t)=v(0)+∑a×δt
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
After the free fall the device is damaged and most probably dont work anymore. I dont think you can read any parameters nowBut can i detect a drop after a free fall?
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)
Yes. Sure.t must not be only on a heart attack, it could be whyle riding a bike, jogging..
yes, thats correct.Yes. Sure.
I just wanted to explain that there are situations where you will get "no (or a minimal) acceleration". too less to "start an Alert"