How can I obtain minutes and seconds from iphone compass?
I have an app that uses de iPhone's compass. I use the CLLocationDirection magneticHeading value. It is given only in degrees like 234.543, and when I turn the iPhone, for example,开发者_如何学Go it changes to 235.543 236.543 237.543 238.543 and so on. The point value (.543) doesn't change. I would like obtain more accuracy than degrees, I mean, I want the point value (.543) changes too when I turn the iPhone, or obtain the minutes/seconds value. Anyone knows how can I have more precision in this value? Thanks!
I'm not familiar with the iPhone API, but I am familiar with sensors for embedded systems. If it's a magnetic compass sensor, you're probably getting orientation from the sensor with 1 degree resolution. (which is amazing that it can be that accurate, given the relatively small magnetic fields from the Earth)
Try looking at both the magneticHeading and the trueHeading (per the API docs). I'll bet the magnetic deviation is calculated more precisely than in 1 degree increments, and that's why you're seeing the .543; you might see a different number if you travel 100km east or west.
精彩评论