Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to interpret the accelerometer readings from iPhone
- - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
- {
- float g = 9.80665f;
- float x = acceleration.x * g;
- float y = acceleration.y * g;
- float z = (acceleration.z + 1.0f) * g;
- // x, y, and z now hold the absolute acceleration in ms^-2
- }
Add Comment
Please, Sign In to add comment