From 66cbfca99c520ea1a2dc611d21a9aa963f942532 Mon Sep 17 00:00:00 2001 From: ffabi Date: Fri, 10 May 2019 13:49:30 +0200 Subject: [PATCH] =?UTF-8?q?Changed=20also=20the=20datatype=20of=20temperat?= =?UTF-8?q?ur=20values=20to=20be=20able=20to=20get=20corr=E2=80=A6=20(#532?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fabian --- esphome/components/mpu6050/mpu6050.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/mpu6050/mpu6050.cpp b/esphome/components/mpu6050/mpu6050.cpp index deba316a7f..06f8951bf5 100644 --- a/esphome/components/mpu6050/mpu6050.cpp +++ b/esphome/components/mpu6050/mpu6050.cpp @@ -110,7 +110,7 @@ void MPU6050Component::update() { float accel_y = data[1] * MPU6050_RANGE_PER_DIGIT_2G * GRAVITY_EARTH; float accel_z = data[2] * MPU6050_RANGE_PER_DIGIT_2G * GRAVITY_EARTH; - float temperature = raw_data[3] / 340.0f + 36.53f; + float temperature = data[3] / 340.0f + 36.53f; float gyro_x = data[4] * MPU6050_SCALE_DPS_PER_DIGIT_2000; float gyro_y = data[5] * MPU6050_SCALE_DPS_PER_DIGIT_2000;