I think that there are some issues with the earth Gravity, so I wonder if there are any examples where the accelerometers work by subtracting these.
views:
855answers:
2
+3
A:
(It's too bad you can't file a bug with planet Earth to fix its Gravity issue!)
There are several examples listed under "Related sample code" in the UIAcceleration Class Reference.
As that doc states, a value of 1.0 represents roughly +1g. So if you point the iPhone straight up in portrait orientation, you should see roughly <0, -1, 0>. As you rotate the phone around, the magnitude of the acceleration vector sqrt(x*x+y*y+z*z)
should stay around 1.
Daniel Dickison
2009-05-05 17:16:06
+2
A:
Apple's AccelerometerGraph demo includes sample code that implements a high-pass filter-- effectively filtering out the effect of gravity. It's pretty simple to just grab it and modify to suit your needs.
Tom Harrington
2009-05-05 19:00:52
Thnaks for the hint!
Thanks
2009-05-05 20:56:03