def __init__(self, addr=SHT31_BASEADDR, lock=None): I2C.__init__(self, lock) self.i2c_addr = addr self.__temperature = 0 self.__humidity = 0 self.__lastread = -1
def __init__(self, address): I2C.__init__(self, address) self.write(0x21) self.write(0x81) # clear buffer for d in range(0, 10, 2): self.write16(d, 0)
def __init__(self, bus = 1): I2C.__init__(self, 0x40, bus) self.CMD_RESET = 0xFE self.CMD_READ_TEMP_NO_HOLD = 0xE3 self.CMD_READ_HUM_NO_HOLD = 0xF5 self.CMD_READ_REG = 0xE7 self.CMD_WRITE_REG = 0xE6
def __init__(self, bus=1, bl=1): I2C.__init__(self, 0x27, bus) self.bl = bl self._write_cmd(self.CMD_FSET | self.SET_2LINES) self._write_cmd(self.CMD_ON | self.ON_DISPLAY) self._write_cmd(self.CMD_ENTRY | self.ENTRY_RIGHT) self.cls()
def __init__(self, i2c_addr=BME_680_BASEADDR, gas_measurement=True, qv_temp=None, \ qv_humi=None, qv_pressure=None, qv_airquality=None, lock=None): BME680Data.__init__(self) I2C.__init__(self, lock) self.i2c_addr = i2c_addr self.gas_measurement = gas_measurement self.__qv_temp = qv_temp self.__qv_humi = qv_humi self.__qv_pressure = qv_pressure self.__qv_airquality = qv_airquality self.chip_id = self._get_regs(CHIP_ID_ADDR, 1) if self.chip_id != CHIP_ID: raise RuntimeError( "BME680 not found. Invalid CHIP ID: 0x{0:02x}".format( self.chip_id)) self.soft_reset() self.set_power_mode(SLEEP_MODE) self._get_calibration_data() self.set_humidity_oversample(OS_2X) self.set_pressure_oversample(OS_4X) self.set_temperature_oversample(OS_8X) self.set_filter(FILTER_SIZE_3) self.set_gas_status(ENABLE_GAS_MEAS) self.get_sensor_data_lock = threading.Lock() self.get_sensor_data() self.baselinethread = None if self.gas_measurement: self._calculate_air_quality_baseline()
def __init__(self, address): I2C.__init__(self, address)
def __init__(self, address): I2C.__init__(self, address) self.write8(0x0B, 0x55) # configure 12-15 to outputs self.write8(0x0C, 0x55) # configure 16-19 to outputs self.write8(0x04, 0x01) # exit standby