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
1 answer

UIAcceleration filtering

I found the following piece of code in apple guidelines: - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration { //Use a basic low-pass filter to only keep the gravity in the accelerometer values …
Ilya Suzdalnitski
  • 52,598
  • 51
  • 134
  • 168
0
votes
1 answer

iOS: Sense small device vibrations - e.g. Sleep monitoring apps

I am wanting to have my device sense small vibrations, such as a small shake, or someone breathing. I am assuming that this is possible because the app store has a number of "Sleep Pattern Monitor" apps, and they have good reviews. Does anyone know…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
0
votes
1 answer

multiple Instances with shared UIAccelerometer not working for all instances

I have a custom UIImageView class that I want to use to control my UIImageViews. Inside the custom init method I have the following regarding the UIAccelerometer: UIAccelerometer *accelerometer = [UIAccelerometer sharedAccelerometer]; …
0
votes
1 answer

Changing UIAccelerometer's updateInterval via a UISlider

I'm trying to change my UIAcceleromter's updateInterval via a UISlider that I have in my .xib. My NSLogs shows me the values perfectly, but the acceleromter's interval does not increase in speed when I move the slider. I'm not sure what's wrong. I…
klcjr89
  • 5,862
  • 10
  • 58
  • 91
-1
votes
1 answer

How i can recognize big tap on the iPhone back?

I want to recognize a big tap on the iPhone back using accelerometer? How i can do this? Thanks the answers,
flatronka
  • 1,061
  • 25
  • 51
-1
votes
1 answer

How can I configure the sensors (Accelerometer or gyroscope) to do something when the user shakes or rotate the phone?

How can I configure the sensors (Accelerometer or gyroscope) to do something when the user shakes or rotate the phone? I want to show a new string each time the user shakes the phone. Also I need a button to start and finish the sensors "action". …
Raffaelli L.C.
  • 5,237
  • 5
  • 11
  • 18
-1
votes
1 answer

How to convert accelerometer sensor data to step counter?

I want to build a step counter widget with flutter but don't know how can I convert the accelerometer sensor data of X, Y and Z axis to the step counter with the help of sensor flutter package.
Tushar Rai
  • 2,371
  • 4
  • 28
  • 57
-2
votes
1 answer

UIAccelerometer reference

Can anybody suggest to me some good applications that make use of UIAccelerometer Class and some references too ?
Sid
  • 17
  • 1
  • 3
1 2 3 4 5 6 7
8