From 40f75e24b348511e11cd27e6db4491f5c279fad2 Mon Sep 17 00:00:00 2001 From: glider-gun Date: Wed, 4 Nov 2020 06:32:19 +0900 Subject: [PATCH] =?UTF-8?q?BME280=E3=81=AE=E8=AA=AD=E3=81=BF=E5=87=BA?= =?UTF-8?q?=E3=81=97=E3=82=92=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E5=87=BA=E3=81=97=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BME280/Python27/bme280_sample.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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]