Skip to content

Commit

Permalink
Hygrometer: add DHT_I2C_NANO_BACKPACK resolution without test
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlup authored and rwaldron committed Feb 20, 2018
1 parent 376184a commit 904b79d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/hygrometer.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,22 @@ var Controllers = {
}
},
toRelativeHumidity: {
// DHT11
// Datasheet available at http://www.micropik.com/PDF/dht11.pdf
// From Table at page 4
// Typical resolution 1%RH
//
// DHT21
// Datasheet available at https://kropochev.com/downloads/humidity/AM2301.pdf
// From paragraph 5 at page 2
// Resolution 0.1%RH
//
// DHT22
// Datasheet available at https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf
// From paragraph 3 at page 2
// Resolution 0.1%RH
value: function(raw) {
return raw / 100;
return toFixed(raw / 100, 1);
}
}
},
Expand Down

0 comments on commit 904b79d

Please sign in to comment.