I am in the process of developing an augmented reality iphone app in javascript using the phonegap library and it's turning out quite well. I put a low pass filter to calm down the accelerometer readings used on tilt of the device which works very nicely. However, I can't get a smooth left/right moving. It seems that my magentometer will only update everytime it moves a whole degree. Onload, I'm looking at a value of 196.721054, and then rotating it left, it doesn't budge until it gets to 195.721054 (one degree difference). Surely, this device has to be more precise than one degree of rotation.
Does anybody know if there's a setting to lower the threashold of this to get more frequent updates? FYI, here's my code:
var magneticHeading;//global variable
function startCollectingData() {
magneticHeadingWatchID = navigator.compass.watchHeading(function(heading){
magneticHeading=heading.magneticHeading;//save it as a global variable
}, function(){/*don't do anything onFail*/},
{ frequency: 100});
}
I read somewhere that in the options, I can do something like headingFilter:.01, but that doesn't seem to help much.
Thoughts?