daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top