This extension is provided as-is without warranty. You are free to use it to your heart's content at your own risk.
First of all, download the Zip file from here:
http://dl.dropbox.com/u/32296241/iOS...for%20MMF2.zip
Once downloaded extract the zip file and follow these instructions:
1. Copy Angle.mfx into your MMF2 Program folder under Extensions
2. Copy Angle.ext to your MMF2 Program folder under Data\Runtime\iPhone
3. If you plan to create a PC version of your App copy Angle.mfx into your MMF2 Program folder under Data\Runtime.
There is a sample project called Angle Test.mfa that you can test with. The angle is returned as a value between 0 and 359 just like MMF2 likes for setting the angle of Actives.
Two very important thing:
1. On Windows and in the iOS Simulator Angle events DO NOT OCCUR so you always get 0. This will only work on a real iOS running device and is a limitation of the iOS Simulator not the coding.
2. Every iOS device has a slight imperfection around angle (+/- 4 degrees and rumor is sometimes more) so you may want to either approximate the angle to quantized values such as Int(CurrentAngle/15) * 15 or you may even want to add a simple calibration routine to your app.
The technique I use to quantize Int(CurrentAngle/15) * 15 above is also a good way to smooth out the reading. I suggest you play with this approach to get the reaction you want though you may simply just want the real deal.
If you have any questions or suggestions PM me. Hope this helps you guys out.