Guest User

Untitled

a guest
Sep 14th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. How to interpret the accelerometer readings from iPhone
  2. - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
  3. {
  4. float g = 9.80665f;
  5. float x = acceleration.x * g;
  6. float y = acceleration.y * g;
  7. float z = (acceleration.z + 1.0f) * g;
  8. // x, y, and z now hold the absolute acceleration in ms^-2
  9. }
Add Comment
Please, Sign In to add comment