mirror of
https://github.com/esphome/esphome.git
synced 2024-12-23 05:54:56 +01:00
Changed also the datatype of temperatur values to be able to get corr… (#532)
Co-authored-by: Fabian <git@ffabi.com>
This commit is contained in:
parent
b0e6b48c50
commit
66cbfca99c
1 changed files with 1 additions and 1 deletions
|
@ -110,7 +110,7 @@ void MPU6050Component::update() {
|
||||||
float accel_y = data[1] * MPU6050_RANGE_PER_DIGIT_2G * GRAVITY_EARTH;
|
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 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_x = data[4] * MPU6050_SCALE_DPS_PER_DIGIT_2000;
|
||||||
float gyro_y = data[5] * MPU6050_SCALE_DPS_PER_DIGIT_2000;
|
float gyro_y = data[5] * MPU6050_SCALE_DPS_PER_DIGIT_2000;
|
||||||
|
|
Loading…
Reference in a new issue