Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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));