English 中文(简体)
Accelerometer detecting side to side movements
原标题:

can someone please give me an example of how you detect if the iphone is moving left or moving right. like a long version of a shake i want my app to be able to know if the users arm is going right or left. imagine your hand like a window wiper with the phone at the end

any ideas?

Thanks, Sam :P

最佳回答

That would be the acceleration.x value. Imagine 3 lines going through your iPhone:
1) a line perpendicular to your iPhone screen and going through it, that would be Z.
2) a horizontal and parallel line to your screen, that would be X (what you re looking for).
3) a vertical and parallel line to your screen, that would be Y.

So, moving the iPhone left or right will generate changes in the X graph. Moving the iPhone up or down will generate changes in the Y graph. Moving your iPhone forward or backward will generate changes in the Z graph.
Hope this helps you grasp the accelerometer s concept,
~ Natanavra.

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签