Determine 180 degree turn using compass

Kay C Lan lan.kc.macmail at gmail.com
Tue Jan 17 00:39:58 EST 2012


Hi Thomas,

To me, determining laps by heading seems to be very inaccurate, but I don't
fully understand your requirements. The only thing I suggest is using the
'accuracy' value as returned by the iPhoneCurrentHeading() function rather
than your current fixed value of 150. If the number is very low, then you
might be able to set a number much closer to 180 and more accurately
determine your laps. i.e.

put 175 - tHeading["accuracy"] into tDegreesForLap

If the number is very large (and I'm sure I've seen the compass out by 45
degrees) you might wish to quit your program or at least advise the user
that the app is unlikely to respond as expected.

HTH



More information about the use-livecode mailing list