diff --git a/BME280/Python27/bme280_sample.py b/BME280/Python27/bme280_sample.py index 3447ecf..63d1294 100755 --- a/BME280/Python27/bme280_sample.py +++ b/BME280/Python27/bme280_sample.py @@ -59,9 +59,7 @@ def get_calib_param(): digH[i] = (-digH[i] ^ 0xFFFF) + 1 def readData(): - data = [] - for i in range (0xF7, 0xF7+8): - data.append(bus.read_byte_data(i2c_address,i)) + data = bus.read_i2c_block_data(i2c_address, 0xF7, 8) pres_raw = (data[0] << 12) | (data[1] << 4) | (data[2] >> 4) temp_raw = (data[3] << 12) | (data[4] << 4) | (data[5] >> 4) hum_raw = (data[6] << 8) | data[7]