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.
Revision 4:21de62ebf215, committed 2019-01-07
- Comitter:
- certvert
- Date:
- Mon Jan 07 10:57:07 2019 +0000
- Parent:
- 3:6937e130feca
- Commit message:
- No change made.
Changed in this revision
| DHT.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/DHT.cpp Sat May 28 11:11:34 2016 +0000
+++ b/DHT.cpp Mon Jan 07 10:57:07 2019 +0000
@@ -135,7 +135,7 @@
float DHT::CalcTemperature()
{
- int v;
+ float v;
switch (_DHTtype) {
case DHT11:
@@ -143,12 +143,12 @@
return float(v);
case DHT22:
v = DHT_data[2] & 0x7F;
- v *= 256;
+ v *= 256.0f;
v += DHT_data[3];
- v /= 10;
+ v /= 10.0f;
if (DHT_data[2] & 0x80)
v *= -1;
- return float(v);
+ return v;
}
return 0;
}