1. You will NEVER get precise or accurate readings with a digital compass inside the basement of a house. You must test it in an area completely free from magnetic and electromagnetic interference. Caves work well! If you must be tethered to a laptop via USB for development, use a long 5-meter cable.
2. De-bounce your button press in firmware. Don't start sampling the sensor until you've delayed a small time interval due to the physical movement of the actuation. Even better, add a feature with a one or two second delay after button press like the delay on a digital camera; this is a feature that the DistoX sorely lacks.
3. Expect random variation from the sensor. Take multiple samples and combine them into an average. Consider throwing a "warning" if the distribution of samples is too wide, as this could indicate interference.
4. Do not be afraid to "stand on the shoulders of giants". See design docs for DUSI
, Shetland Attack Pony
5. Lynn Brucker
has a large amount of real-world digital instrument testing experience and has posted a great deal about it in the Survey & Cartography