Are there any good examples of how to use accelerometers in iPhone OS?
2 answers
(Too bad you can't log a bug on planet Earth to fix her gravity problem!)
There are several examples, listed in the "Related Code Sample" section of UIAcceleration Class Reference .
As stated in this document, 1.0 is roughly + 1g. So if you point the iPhone directly in portrait orientation, you'll see something like <0, -1, 0>. When you rotate the phone around, the magnitude of the acceleration vector sqrt(x*x+y*y+z*z)
should remain around 1.
+3
source to share