Hersh Bhargava
Hersh Bhargava

Reputation: 615

Get Angle from Gyro

I am working on a project, and part of it needs to measure the rotation of the device. I assume that the most efficient way to do this would be with the gyroscope, but please correct me if I am wrong. I really have no idea where to start, so any pointers would be greatly appreciated.

Upvotes: 1

Views: 1321

Answers (2)

Aleksejs Mjaliks
Aleksejs Mjaliks

Reputation: 8707

Check out Core Motion framework available in iOS starting 4.0. It provides a lot of ready stuff to work gyro and accelerometer at high level without need to work will low level data.

Upvotes: 0

Tom van der Woerdt
Tom van der Woerdt

Reputation: 29975

You'd have to start by including the CoreMotion framework. Then refer to the documentation for a good outline of the CMMotionManager class.

The actual implementation is very easy - implement the delegate and tell the manager that you want to start receiving notifications.

Upvotes: 1

Related Questions