def __init__(self, type, scl, sda):
self.type = type
if self.type == 0:
i2c_bus = I2C(scl=Pin(scl), sda=Pin(sda), freq=100000)
self.sensor = BMP180.BMP180(i2c_bus)
self.sensor.oversample_sett = 2
self.sensor.baseline = 101325
elif self.type == 1:
pass #TODO
else:
log.error("Unknown sensor type '{}'. Cannot instantiate it.".format(self.type))
# @timed_function
评论列表
文章目录