The book presents one way function of a digital compass.The program is designed to determine the position of heading angle. The program has a function which measures the magnetic field and the magnetic acceleration. As a result, was created a method which draws a graphical compass whose magnetic needle pointing to the measured value.