Earlier this year I wrote an article about HTML compass madness. Recently, I had to work on this a bit more to make the code more stable and universal... and so WebCompass project was born. It's now not only purely in-browser compass but can also use PhoneGap API if available. This way it will use a native compass in a more direct manner which should make it more accurate and greatly simplifies calibration.
Links