Pregunta

Can i know through Gyroscope, if I've moved some distance?

To elaborate my question, can I be able to detect the device's motion if the user moves a couple of feet from the starting position?

Thanks in advance.

¿Fue útil?

Solución

Linear motion is detected using the accelerometer. Rotation is detected using the gyroscope.

You can use the CMDeviceMotion class to detect both types of movement. You will have to integrate the value of userAcceleration over time to detect a change in position.

Check out the What's New in Core Motion video from WWDC 2011. You will probably find it helpful.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top