def get(self): try: compass = hmc5883l(port=self.PORT, address=self.ADDRESS, gauss=4.7, declination=self.DECLINATION) return [compass.axes(), compass.degrees(compass.heading())] except Exception, e: logger.critical("Exception ! " + str(e))
def realTime(self): compass = hmc5883l(port=self.PORT, address=self.ADDRESS, gauss=4.7, declination=self.DECLINATION) while True: sys.stdout.write("\rHeading: " + compass.degrees(compass.heading()) + " ") sys.stdout.flush() time.sleep(0.5)
def realTime(self): compass = hmc5883l(port = self.PORT, address = self.ADDRESS, gauss = 4.7, declination = self.DECLINATION) while True: sys.stdout.write("\rHeading: " + compass.degrees(compass.heading()) + " ") sys.stdout.flush() time.sleep(0.5)
def get(self): try: compass = hmc5883l(port = self.PORT, address = self.ADDRESS, gauss = 4.7, declination = self.DECLINATION) return [ compass.axes(), compass.degrees(compass.heading()) ] except Exception, e: logger.critical("Exception ! " + str(e));