-
-
Save videlais/83eb45eab027ddb6be3d to your computer and use it in GitHub Desktop.
Accelerometer2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function handleOrientation(event) { | |
absolute = event.absolute; | |
alpha = event.alpha; | |
beta = event.beta; | |
gamma = event.gamma; | |
} | |
function handleMotion(event) { | |
acceleration = accelerationIncludingGravity = rotationRate = {}; | |
acceleration.x = event.acceleration.x; | |
acceleration.y = event.acceleration.y; | |
acceleration.z = event.acceleration.z; | |
accelerationIncludingGravity.x = event.accelerationIncludingGravity.x; | |
accelerationIncludingGravity.y = event.accelerationIncludingGravity.y; | |
accelerationIncludingGravity.z = event.accelerationIncludingGravity.z; | |
rotationRate.alpha = event.rotationRate.alpha; | |
rotationRate.beta = event.rotationRate.beta; | |
rotationRate.gamma = event.rotationRate.gamma; | |
interval = event.interval; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment