Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Cosmic_Pi_STM32_i2c
Diff: Si7020.cpp
- Revision:
- 1:eca9d19c17ab
- Parent:
- 0:9a1febb56203
- Child:
- 2:b082ba73bed0
--- a/Si7020.cpp Fri Apr 17 09:53:45 2015 -0500 +++ b/Si7020.cpp Fri Apr 17 11:25:00 2015 -0500 @@ -252,7 +252,7 @@ // Calculate the temperature using the formula from the datasheet // Scaled by 100 - *tempC = (((float)175.72 * code) / 65536) - 46.85; + *tempC = ((175.72f * (float)code) / 65536.0f) - 46.85f; return 0; } @@ -328,7 +328,7 @@ code = ((uint16_t)data[0] << 8) + data[1]; // Calculate the humidity using the formula from the datasheet - *humid = (((float)125 * code) / 65536) - 6; + *humid = ((125.0f * (float)code) / 65536.0f) - 6.0f; return 0; }