I'm using the accelerometer to move an object on my screen. It's only working when the iphone is flat.
If I use the iPhone in another position, the object is not moving like I want (the Y axis is not well managed).
So, I've to calibrate the position of the accelerometer, I guess. But I've no idea how to do this.
Please help me.
Thanks in advance.
Regards, ALpesH
hi hope all is well. A simple google search came up with this beautiful post. It is exactly what you wanted. A tutorial on Accelerometer Calibration & Optimizations.
This tutorial assumes you know the basics of the accelerometer. If not there are plenty of tutorials on google that will help get you accustomed to the accelerometer basics.
This tutorial will focus on 3 things:
First off, why bother adding these features? Simple. Launch your accelerometer based game and try the following tests:
Obtained from this website:
Let me know if this helps if it does choose this as the answer. Other than that if you need any more help let me know
Ive implemented this tutorial code in my own app and i am not playing a simple ping pong game upside down and also playing it on the side whilst lying on the bed. :D
Pk