What exactly does the iPhone accelerometer measure?
The apple documentation for UIAcceleration class says,
“When a device is laying still with its back on a horizontal surface, each acceleration event has approximately the following values:
iOS Using NSDictionary to load data into section and rows Two Query Constraints On One Key with Parse and Swift Set title labels of buttons in table view from an array full of strings HTML with <blockquote> tags in UITextView UITableViewRowAnimation is ignored UIWindow? does not have member named bounds
Now, I am confused! How can the acceleration be non-zero, when you clearly say the “device is laying still”?
Judging by the responses, I think this should be called something like ‘forceometer’ or ‘gravitometer’ and not accelerometer!
- Convert binary two's complement data into integer in objective-c
- Measuring velocity via iPhone SDK
- Detecting Acceleration in a car (iPhone Accelerometer)
- “pushes” matching UIInterpolatingMotionEffect? (i.e. access “physics” on UIInterpolatingMotionEffect)
- iOS: Can I get the pitch/yaw/roll from accelerometer data?
- How to use accelerometer for paint on a screen in iphone?
6 Solutions Collect From Internet About “What exactly does the iPhone accelerometer measure?”
You get a -1 on the Z axis because gravity is acting on the device, applying a constant acceleration of 1G. I assume you want user acceleration, which you can get from the DeviceMotion object using a device motion handler as opposed to an acceleration handler. The
userAcceleration property filters out the effects of gravity on the device and only gives you how much the user is accelerating it.
I found the answer [in the CoreMotion Reference guide, thanks to bensnider:
The accelerometer measures the sum of two acceleration vectors: gravity and user acceleration. User acceleration is the acceleration that the user imparts to the device.
You’ll find the best answers in datasheet of the accelerometer used (LIS302DL).
It measures the gravity. The unit is chosen so that the gravity, 9.81 m/s^2, equals 1 unit. The sign tells how the phone axis is directed. In other words, what the phone considers downwards.
The phone measures 0 as acceleration in free fall. I don’t know how much you want to throw your phone up and down to test it 🙂
When you’re sitting, gravity is pulling you down to your chair. If it weren’t for the chair or ground for that matter, you’d be falling down with acceleration of about 9.8m/s^2. In order for the chair to prevent you from falling down, it has to act with a force in the opposite direction with at least the same value.
The accelometer shows the value of the pulling force and it’s a three-dimensional vector. In this case it’s directed straight down. And the value given is expressed in
G, units of gravity acceleration multiplied by that value.
Answerers keep missing the right wording that should set it straight for you… The device is “laying still” only relatively to you. It is actually not laying still at all. The http://en.wikipedia.org/wiki/Centripetal_force of gravity gives it (and you) centripetal acceleration. It is real, it is what keeps you from flying off Earth on a tangent, and it is what the accelerometer dutifully shows. (Earth is nothing special – we rotate about the Sun also etc etc, whose centripetal accelerations are way smaller, but they would be all shown by an accelerometer sensitive enough.)
- How to cancel facebook login?
- Button Animate like ios game center button
- iOS UITableView with dynamic text and images rendered together (NSAttributedString + images)
- Testing 3D touch with iOS Simulator
- swift sprite kit game when I shoot on a enemy sometimes the bullet goes trough the enemy, how can I fix this?
- Core Animation, unexpected animated position and hitTest values
- Genie or Similar Effect for Add to Favourites
- How passing a protocol as parameter in Swift
- Can I have iAds and In-app Purchase to remove ads in one single app?
- How do I get the count of a Swift enum?
- Saving Variables on app exit
- How do I get the current access point's MAC address/BSSID?
- What is the best way to store an array of objects with cocoa?
- Swift UIPasteboard not copying PNG
- how to get input from UIAlertView?