Exemple #1
0
    def __init__(self, address=0x77, mode=1, debug=False):

        myrevision = TTLib.getrevision()
        if myrevision == "0002" or myrevision == "0003":
            self.i2c = I2C(address, 0)
        else:
            self.i2c = I2C(address, 1)

        self.address = address
        self.debug = debug
        # Make sure the specified mode is in the appropriate range
        if ((mode < 0) | (mode > 3)):
            if (self.debug):
                print("Invalid Mode: Using STANDARD by default")
            self.mode = self.__BMP085_STANDARD
        else:
            self.mode = mode
        # Read the calibration data
        self.readCalibrationData()
Exemple #2
0
 def __init__(self, address=0x77, mode=1, debug=False):
   
   myrevision = TTLib.getrevision()
   if myrevision == "0002" or myrevision == "0003" :
       self.i2c = I2C(address,0)
   else:
       self.i2c = I2C(address,1)
       
   self.address = address
   self.debug = debug
   # Make sure the specified mode is in the appropriate range
   if ((mode < 0) | (mode > 3)):
     if (self.debug):
       print "Invalid Mode: Using STANDARD by default"
     self.mode = self.__BMP085_STANDARD
   else:
     self.mode = mode
   # Read the calibration data
   self.readCalibrationData()