Advertisement
Guest User

Untitled

a guest
Dec 25th, 2013
562
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     def Get_RawOutX_Value(self):
  2.         """Raw X angular speed data"""
  3.         l = self.__readFromRegister(self.__REG_R_OUT_X_L, 0xff)
  4.         h_u2 = self.__readFromRegister(self.__REG_R_OUT_X_H, 0xff)
  5.         h = bitOps.TwosComplementToByte(h_u2)
  6.         if (h < 0):
  7.             return (h*256 - l) * 0.0175
  8.         elif (h >= 0):
  9.             return (h*256 + l) * 0.0175
Advertisement
RAW Paste Data Copied
Advertisement