1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- from time import sleep
- import pyupm_hmc5883l as hmc5883l
-
-
- hmc = hmc5883l.Hmc5883l(0)
- hmc.set_declination(0.2749)
-
-
- while True:
-
- hmc.update()
- pos = hmc.coordinates()
- hdg = hmc.heading()
- dir = hmc.direction()
-
-
- print "Coor: %5d %5d %5d" % (pos[0], pos[1], pos[2])
- print "Heading: %5.2f" % (hdg)
- print "Direction: %3.2f\n" % (dir)
-
-
- sleep(1)
|