Questions tagged [uiaccelerometer]

The UIAccelerometer class lets you register to receive acceleration-related data from the onboard hardware. As a device moves, its hardware reports linear acceleration changes along the primary axes in three-dimensional space. You can use this data to detect both the current orientation of the device (relative to the ground) and any instantaneous changes to that orientation. Deprecated in iOS 5.0. Available in iOS 2.0 and later.

Deprecated in iOS 5.0. Available in iOS 2.0 and later. The UIAccelerometer class lets you register to receive acceleration-related data from the onboard hardware. As a device moves, its hardware reports linear acceleration changes along the primary axes in three-dimensional space. You can use this data to detect both the current orientation of the device (relative to the ground) and any instantaneous changes to that orientation. You might use instantaneous changes as input to a game or to initiate some action in your application.

You do not create accelerometer objects directly. Instead, you use the shared UIAccelerometer object to specify the interval at which you want to receive events and then set its delegate property. Upon assigning your delegate object, the accelerometer object begins delivering acceleration events to your delegate immediately at the specified interval. Events are always delivered on the main thread of your application.

The maximum frequency for accelerometer updates is based on the available hardware. You can request updates less frequently but cannot request them more frequently than the hardware maximum. Once you assign your delegate, however, updates are delivered regularly at the frequency you requested, whether or not the acceleration data actually changed. Your delegate is responsible for filtering out any unwanted updates and for ensuring that the amount of change is significant enough to warrant taking action.

For more information about the data delivered to your observer, see UIAcceleration Class Reference. For information about implementing your delegate object, see UIAccelerometerDelegate Protocol Reference.

113 questions
0
votes
2 answers

UIAccelerometer is Shaking

I want a functionality in which i want to detect if my device is being shaked.The problem is i can detect the shake with didAccelerate method of UIAcceleratorDelegate , but i dont know how to detect if the device is still shaking. I want to play an…
aditya
  • 27
  • 1
  • 4
0
votes
1 answer

How to get Acceleration Time & Acceleration Magnitude in iPhone

Currently I'm trying to use CMAcceleration to get accelerometer values for x,y& z axis is it possible to get Acceleration Time & Acceleration Magnitude with this x,y & z values.When i checked the developer forum i can't find any delegates / methods…
siva
  • 1,402
  • 2
  • 14
  • 28
0
votes
0 answers

Accelerometer direction ios

The formula for calculating acceleration from accelerometer values is sqrt(accelerometer.x^2 + accelerometer.y^2 + accelerometer.z^2).. But this does not give the direction in which the acceleration is happening. If there is a method that could even…
nr5
  • 4,228
  • 8
  • 42
  • 82
0
votes
1 answer

UI Accelerometer reference to compute the distance traveled by a person

How can I use the UIAccelerometer class to compute the distance traveled by a person?
Sid
  • 17
  • 1
  • 3
0
votes
3 answers

iphone moving direction using accelerometer

I want some help on UIAccelerometer class. I want to find some way to find out or distinguish when I wave iphone device from right-to-left and the left-to-right. I am getting x,y,z values as well as interval value. I am also getting velocity and…
Ruchir Shah
  • 898
  • 3
  • 13
  • 31
0
votes
1 answer

Get total Acceleration from 3 axes?

I get all 3 axes using this timer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(Accelerometer) userInfo:nil repeats:YES]; [timer fire]; Edit -(void)Accelerometer { float accex1 =…
Chirag Dj
  • 630
  • 2
  • 9
  • 27
0
votes
1 answer

What is the difference between "UIAccelerometer" and "CLLocationManager"?

What is the difference between "UIAccelerometer" and "CLLocationManager"? Both give me x, y and z axis as result. UIAccelerometer X -18.000 Y -03.500 Z -41.000 CLLocationManager X -0.036 Y -0.002 Z -1.069 Is this information from the same…
Thomas Kekeisen
  • 4,355
  • 4
  • 35
  • 54
0
votes
1 answer

finding the distance from point A to point B for iPhone

Hey I'm trying to calculate the distance of 1 spot to another on the iPhone (horizontally) Im not sure how
wafflez180
  • 55
  • 1
  • 1
  • 7
0
votes
3 answers

Windows phone 8.1 Accelerometer and updating UI

I having problems finding documentation or examples regarding the proper way to use the Accelerometer as well as updating a textbox using Dispatcher. Seems like it should be easy, but all the examples are 8.0 which apparently used using…
0
votes
0 answers

Delay in receiving device motion updates from CMMotionManager

I have an app with a view that, when loaded, gets regular device motion updates (20 per second) and uses them to display things on the screen. This was working fine using the old (deprecated) UIAccelerometer code. I have since ported it to use Core…
DanielGibbs
  • 9,910
  • 11
  • 76
  • 121
0
votes
1 answer

How to detect M7 co-processor sensoring in an application

I just wanted to make clear. I am using accelerometer in my app, So do we need to add any other framework or method to receive iPhone5s's M7 co-processor data? Is that enough of using CoreMotion framework with Method…
0
votes
1 answer

I cant get UIScrollView and UIAccelerometer to play nice, even with threading

problem is, everytime i go into my application and scroll around inside the scrollview, everything else in the program is completely useless, and tills I stops me scrolling, the accelerometer, and not to mention everything else wont do a thing, if…
0
votes
1 answer

Replace sharedAccelerometer with motionManager iOS

I've tried several method but I cannot find a working method to replace my [[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / kAccelerometerFrequency)]; [[UIAccelerometer sharedAccelerometer] setDelegate:self]; most recently i've…
inVINCEable
  • 2,167
  • 3
  • 25
  • 49
0
votes
2 answers

maximal acceleration of UIAccelerometer

i want to track how fast my iPhone is moved. i checked the AceelerometerGraph Example App, where the maximum Amount was about 2.0 (in this app) i want to know how exactly i can track the speed of my moving iphone. in this example app the maximum…
choise
  • 24,636
  • 19
  • 75
  • 131
0
votes
1 answer

UIAccelerometer issue with landscape mode

I am using UIAccelerometer in my game and it is working fine in portrait mode but not working properly in landscape mode. Can some one fix the issue in my code I am putting my code as below: #import "GameLayer.h" @implementation…