Skip to content

Commit

Permalink
Merge branch 'rht_conversion_fix' into 'master'
Browse files Browse the repository at this point in the history
fixed the RH/T conversion constant

See merge request MSO-SW/drivers/raspberry-pi/raspberry-pi-i2c-scd4x!14
  • Loading branch information
qfisch committed Jun 24, 2022
2 parents efe1719 + 64735d9 commit f3b4106
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Fixed
- Fixed the RH/T conversion constant

## [0.2.2] - 2021-04-30

Expand Down
4 changes: 2 additions & 2 deletions scd4x_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ int16_t scd4x_read_measurement(uint16_t* co2, float* temperature_deg_c,
if (error) {
return error;
}
*temperature_deg_c = (float)temperature * 175.0f / 65536.0f - 45.0f;
*humidity_percent_rh = (float)humidity * 100.0f / 65536.0f;
*temperature_deg_c = (float)temperature * 175.0f / 65535.0f - 45.0f;
*humidity_percent_rh = (float)humidity * 100.0f / 65535.0f;
return NO_ERROR;
}

Expand Down

0 comments on commit f3b4106

Please sign in to comment.