示例#1
0
    def __init__(self):
        #self.bus = smbus.SMBus(1)
        #self.address = 0x40
        #self.bus.write_byte_data(self.address, CMD_SOFT_RESET)

        self.dev = i2c_base.i2c(HTU21D_ADDR, 1)  # HTU21D 0x40, bus 1
        self.dev.write(CMD_SOFT_RESET)  # Soft reset
        time.sleep(.1)
示例#2
0
 def __init__(self):
     self.dev = i2c_base.i2c(HTU21D_ADDR, 1)  # HTU21D 0x40, bus 1
     self.dev.write(CMD_SOFT_RESET)  # Soft reset
     time.sleep(.1)
示例#3
0
 def __init__(self):
     self.dev = i2c_base.i2c(HTU21D_ADDR, 1)  # HTU21D 0x40, bus 1
     self.dev.write(CMD_SOFT_RESET)  # Soft reset
     time.sleep(.1)
示例#4
0
文件: MCP342X.py 项目: stsb11/weather
 def __init__(self, address=0x69):
     self.dev = i2c_base.i2c(address, 1)
     self.max = 32767.0  #15 bits
     self.vref = 2.048
     self.tolerance_percent = 0.5
     self.reset()
示例#5
0
 def __init__(self, address = 0x69):
     self.dev = i2c_base.i2c(address, 1)
     self.max = 32767.0 #15 bits
     self.vref = 2.048
     self.tolerance_percent = 0.5
     self.reset()
示例#6
0
 def __init__(self, address = 0x69):
     self.dev = i2c_base.i2c(address, 1)
     self.max = 32767.0 #15 bits
     if MCP342X.shared == None:
         MCP342X.shared = self
     self.reset()
示例#7
0
 def __init__(self, address = 0x69):
     self.dev = i2c_base.i2c(address, 1)
     self.max = 32767.0 #15 bits
     self.reset()