def _init(self):
self._t1, self._t2, self._t3, self._p1, \
self._p2, self._p3, self._p4, self._p5, \
self._p6, self._p7, self._p8, self._p9, \
_, self._h1 = self._i2c.read_register(self._address, 0x88,
fmt="<HhhHhhhhhhhhBB")
buf = self._i2c.read_register(self._address, 0xE1, amount=7)
self._h6 = struct.unpack_from("<b", buf, 6)[0]
self._h2, self._h3 = struct.unpack("<hB", buf[0:3])
self._h4 = (struct.unpack_from("<b", buf, 3)[0] << 4) | (buf[4] & 0xf)
self._h5 = (struct.unpack_from("<b", buf, 5)[0] << 4) | (buf[4] >> 4)
self._tfine = 0
self._i2c.write(self._address, [0xf4, 0x3f])
super()._init()
评论列表
文章目录