The built-in compass sensor returns data that is a bit shaky. It randomly changes in a 1-2 degree span. This causes problems if you need a smooth value for UI work (for example for Augmented Reality).
To solve this problem there is a Zebble plug-in named SmoothCompass. Instead of just the magnetic reading value of compass, it will use a combination of compass value, gyroscope and accelerometer to deliver a smooth and more natural result.